1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:02:55 +08:00

Move cancel code to exit paths for screen

This commit is contained in:
Dean Herbert 2018-03-22 13:01:40 +09:00
parent 8f71d53c17
commit 917334a39a

View File

@ -139,8 +139,7 @@ namespace osu.Game.Screens.Play
{
// as the pushDebounce below has a delay, we need to keep checking and cancel a future debounce
// if we become unready for push during the delay.
pushDebounce?.Cancel();
pushDebounce = null;
cancelLoad();
return;
}
@ -149,7 +148,6 @@ namespace osu.Game.Screens.Play
pushDebounce = Scheduler.AddDelayed(() =>
{
pushDebounce = null;
contentOut();
this.Delay(250).Schedule(() =>
@ -173,10 +171,23 @@ namespace osu.Game.Screens.Play
}
}
private void cancelLoad()
{
pushDebounce?.Cancel();
pushDebounce = null;
}
protected override void OnSuspending(Screen next)
{
base.OnSuspending(next);
cancelLoad();
}
protected override bool OnExiting(Screen next)
{
Content.ScaleTo(0.7f, 150, Easing.InQuint);
this.FadeOut(150);
cancelLoad();
return base.OnExiting(next);
}