Skip to content
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

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

luizzeroxis
Copy link
Contributor

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

UndertaleModTool/MainWindow.xaml.cs Outdated Show resolved Hide resolved
UndertaleModTool/MainWindow.xaml.cs Outdated Show resolved Hide resolved
UndertaleModTool/MainWindow.xaml.cs Outdated Show resolved Hide resolved
UndertaleModTool/MainWindow.xaml.cs Show resolved Hide resolved
Comment on lines 784 to 786
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)
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@Miepee Miepee Aug 18, 2024

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;

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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

UndertaleModTool/MainWindow.xaml.cs Outdated Show resolved Hide resolved
UndertaleModTool/MainWindow.xaml.cs Outdated Show resolved Hide resolved
UndertaleModTool/MainWindow.xaml.cs Outdated Show resolved Hide resolved
UndertaleModTool/MainWindow.xaml.cs Outdated Show resolved Hide resolved
}
else
save = true;
MessageBoxResult result = this.ShowQuestionWithCancel("Save changes before quitting?");
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@Miepee Miepee left a 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!

@Miepee Miepee merged commit 468a6ed into UnderminersTeam:master Aug 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants