mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:02:57 +08:00
Change exit logic to be more test-friendly
This commit is contained in:
parent
02e4f3ddaf
commit
9ca0e48acc
@ -438,10 +438,20 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
public override bool OnExiting(IScreen next)
|
public override bool OnExiting(IScreen next)
|
||||||
{
|
{
|
||||||
if (!exitConfirmed && dialogOverlay != null && (isNewBeatmap || HasUnsavedChanges) && !(dialogOverlay.CurrentDialog is PromptForSaveDialog))
|
if (!exitConfirmed)
|
||||||
{
|
{
|
||||||
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
|
// if the confirm dialog is already showing (or we can't show it, ie. in tests) exit without save.
|
||||||
return true;
|
if (dialogOverlay == null || dialogOverlay.CurrentDialog is PromptForSaveDialog)
|
||||||
|
{
|
||||||
|
confirmExit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNewBeatmap || HasUnsavedChanges)
|
||||||
|
{
|
||||||
|
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Background.FadeColour(Color4.White, 500);
|
Background.FadeColour(Color4.White, 500);
|
||||||
|
Loading…
Reference in New Issue
Block a user