mirror of https://github.com/ppy/osu
Closes #5277
This commit is contained in:
parent
ffc3c9f8f6
commit
1a117d1511
|
@ -168,6 +168,8 @@ private void load(OsuColour colours, GameHost host)
|
|||
|
||||
menuBar.Mode.ValueChanged += onModeChanged;
|
||||
|
||||
host.Exiting += onQuittingGame;
|
||||
|
||||
bottomBackground.Colour = colours.Gray2;
|
||||
}
|
||||
|
||||
|
@ -235,16 +237,27 @@ public override void OnEntering(IScreen last)
|
|||
Beatmap.Value.Track?.Stop();
|
||||
}
|
||||
|
||||
private bool isExitingGame = false;
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
Background.FadeColour(Color4.White, 500);
|
||||
|
||||
if (Beatmap.Value.Track != null)
|
||||
{
|
||||
Beatmap.Value.Track.Tempo.Value = 1;
|
||||
Beatmap.Value.Track.Start();
|
||||
if (isExitingGame)
|
||||
{
|
||||
Beatmap.Value.Track.Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
Beatmap.Value.Track.Tempo.Value = 1;
|
||||
Beatmap.Value.Track.Start();
|
||||
}
|
||||
}
|
||||
|
||||
host.Exiting -= onQuittingGame;
|
||||
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
|
||||
|
@ -281,5 +294,7 @@ private void seek(UIEvent e, int direction)
|
|||
else
|
||||
clock.SeekForward(!clock.IsRunning, amount);
|
||||
}
|
||||
|
||||
private bool onQuittingGame() => isExitingGame = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue