1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 15:12:57 +08:00

Revert "Remove unnecessary exitConfirmed condition check"

This reverts commit 38fe519c91.
This commit is contained in:
Joehu 2019-10-02 16:08:19 -07:00
parent 38fe519c91
commit 148089f160

View File

@ -80,9 +80,9 @@ namespace osu.Game.Screens.Menu
Action = () => Action = () =>
{ {
if (holdDelay.Value > 0) if (holdDelay.Value > 0)
this.Exit(); confirmAndExit();
else if (dialogOverlay != null && !(dialogOverlay.CurrentDialog is ConfirmExitDialog)) else if (!exitConfirmed && dialogOverlay != null && !(dialogOverlay.CurrentDialog is ConfirmExitDialog))
dialogOverlay.Push(new ConfirmExitDialog(this.Exit, () => exitConfirmOverlay.Abort())); dialogOverlay.Push(new ConfirmExitDialog(confirmAndExit, () => exitConfirmOverlay.Abort()));
} }
}); });
} }
@ -100,7 +100,7 @@ namespace osu.Game.Screens.Menu
OnEdit = delegate { this.Push(new Editor()); }, OnEdit = delegate { this.Push(new Editor()); },
OnSolo = onSolo, OnSolo = onSolo,
OnMulti = delegate { this.Push(new Multiplayer()); }, OnMulti = delegate { this.Push(new Multiplayer()); },
OnExit = this.Exit, OnExit = confirmAndExit,
} }
} }
}, },
@ -129,6 +129,12 @@ namespace osu.Game.Screens.Menu
preloadSongSelect(); preloadSongSelect();
} }
private void confirmAndExit()
{
exitConfirmed = true;
this.Exit();
}
private void preloadSongSelect() private void preloadSongSelect()
{ {
if (songSelect == null) if (songSelect == null)
@ -166,6 +172,8 @@ namespace osu.Game.Screens.Menu
Beatmap.ValueChanged += beatmap_ValueChanged; Beatmap.ValueChanged += beatmap_ValueChanged;
} }
private bool exitConfirmed;
protected override void LogoArriving(OsuLogo logo, bool resuming) protected override void LogoArriving(OsuLogo logo, bool resuming)
{ {
base.LogoArriving(logo, resuming); base.LogoArriving(logo, resuming);