-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed quitting to show a yes/no/cancel dialog instead of 2 yes/no dialogs #1877
Conversation
UndertaleModTool/MainWindow.xaml.cs
Outdated
if (scriptDialog is not null) | ||
{ | ||
if (this.ShowQuestion("Script still runs. Save anyway?\nIt can corrupt the data file that you'll save.") == MessageBoxResult.Yes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please combine these two checks into one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think they can be combined since if you answer no it should not set the save variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they can. if (scriptDialog is not null && this.ShowQuestion(blabla)) save = true;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that works but now I realized this could work:
if (scriptDialog is null || this.ShowQuestion(blabla)) save = true;
Then remove the else.
Honestly though, who cares about such a small thing lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that it improves readability much more, so would appreciate that being implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worse readability but sure thing boss
} | ||
else | ||
save = true; | ||
MessageBoxResult result = this.ShowQuestionWithCancel("Save changes before quitting?"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing the "are you sure you want to quit" is probably fine to do for now, but if you could add a comment that mentions to only ask whether changes should be saved if the file was changed, and ask whether the user really wants to quit otherwise would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to get if changes have been made; maybe that's for another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it absolutely is, was mostly just mentioning that adding a comment for that would be neat.
Download the artifacts for this pull request here: GUI:
CLI: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment can be added later, good enough to be merged now.
Ty for the PR!
Description
It was really annoying trying to close the program and it showing two dialog boxes back to back! So I changed it so it's a more standard dialog like other programs.
Caveats
Should not be any
Notes
Hopefully this will save several seconds of people's lives