This commit is contained in:
Desconocidosmh 2019-07-07 17:05:53 +02:00
parent ffc3c9f8f6
commit 1a117d1511
1 changed files with 17 additions and 2 deletions

View File

@ -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;
}
}