mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 10:23:20 +08:00
Move non-current handling to PerformExit
Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
parent
53dce83b56
commit
fa87df6c6a
@ -646,7 +646,6 @@ namespace osu.Game.Screens.Play
|
||||
// import current score if possible.
|
||||
prepareAndImportScoreAsync();
|
||||
|
||||
// Screen may not be current if a restart has been performed.
|
||||
if (this.IsCurrentScreen())
|
||||
{
|
||||
skipExitTransition = skipTransition;
|
||||
@ -657,6 +656,12 @@ namespace osu.Game.Screens.Play
|
||||
// - the pause / fail dialog was requested but couldn't be displayed due to the type or state of this Player instance.
|
||||
this.Exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// May be restarting from results screen.
|
||||
if (this.GetChildScreen() != null)
|
||||
this.MakeCurrent();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -722,16 +727,6 @@ namespace osu.Game.Screens.Play
|
||||
skipExitTransition = quickRestart;
|
||||
PrepareLoaderForRestart?.Invoke(quickRestart);
|
||||
|
||||
if (!this.IsCurrentScreen())
|
||||
{
|
||||
// if we're called externally (i.e. from results screen),
|
||||
// use MakeCurrent to exit results screen as well as this player screen
|
||||
// since ValidForResume = false in here
|
||||
Debug.Assert(!ValidForResume);
|
||||
this.MakeCurrent();
|
||||
return true;
|
||||
}
|
||||
|
||||
return PerformExit(quickRestart);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user