mirror of
https://github.com/ppy/osu
synced 2025-03-02 17:42:13 +00:00
Closes #5277
This commit is contained in:
parent
ffc3c9f8f6
commit
1a117d1511
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user