1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Fix OnResume / OnSuspending potentially getting called before OnEntering on a sub screen

This commit is contained in:
Dean Herbert 2023-05-25 20:39:11 +09:00
parent 59768c5ffd
commit b3c2d120bf

View File

@ -132,7 +132,9 @@ namespace osu.Game.Screens.OnlinePlay
this.ScaleTo(1, 250, Easing.OutSine);
Debug.Assert(screenStack.CurrentScreen != null);
screenStack.CurrentScreen.OnResuming(e);
if (screenStack.CurrentScreen.IsCurrentScreen())
screenStack.CurrentScreen.OnResuming(e);
base.OnResuming(e);
}
@ -143,7 +145,9 @@ namespace osu.Game.Screens.OnlinePlay
this.FadeOut(250);
Debug.Assert(screenStack.CurrentScreen != null);
screenStack.CurrentScreen.OnSuspending(e);
if (screenStack.CurrentScreen.IsCurrentScreen())
screenStack.CurrentScreen.OnSuspending(e);
}
public override bool OnExiting(ScreenExitEvent e)