This commit is contained in:
Desconocidosmh 2019-07-07 17:05:53 +02:00
parent ffc3c9f8f6
commit 1a117d1511

View File

@ -168,6 +168,8 @@ namespace osu.Game.Screens.Edit
menuBar.Mode.ValueChanged += onModeChanged; menuBar.Mode.ValueChanged += onModeChanged;
host.Exiting += onQuittingGame;
bottomBackground.Colour = colours.Gray2; bottomBackground.Colour = colours.Gray2;
} }
@ -235,16 +237,27 @@ namespace osu.Game.Screens.Edit
Beatmap.Value.Track?.Stop(); Beatmap.Value.Track?.Stop();
} }
private bool isExitingGame = false;
public override bool OnExiting(IScreen next) public override bool OnExiting(IScreen next)
{ {
Background.FadeColour(Color4.White, 500); Background.FadeColour(Color4.White, 500);
if (Beatmap.Value.Track != null) if (Beatmap.Value.Track != null)
{ {
Beatmap.Value.Track.Tempo.Value = 1; if (isExitingGame)
Beatmap.Value.Track.Start(); {
Beatmap.Value.Track.Stop();
}
else
{
Beatmap.Value.Track.Tempo.Value = 1;
Beatmap.Value.Track.Start();
}
} }
host.Exiting -= onQuittingGame;
return base.OnExiting(next); return base.OnExiting(next);
} }
@ -281,5 +294,7 @@ namespace osu.Game.Screens.Edit
else else
clock.SeekForward(!clock.IsRunning, amount); clock.SeekForward(!clock.IsRunning, amount);
} }
private bool onQuittingGame() => isExitingGame = true;
} }
} }