mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:33:21 +08:00
Simplify editor logic
This commit is contained in:
parent
6819c528db
commit
ad873b542a
@ -224,30 +224,32 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
public override void OnResuming(IScreen last)
|
||||
{
|
||||
Beatmap.Value.Track?.Stop();
|
||||
base.OnResuming(last);
|
||||
Beatmap.Value.Track?.Stop();
|
||||
}
|
||||
|
||||
public override void OnEntering(IScreen last)
|
||||
{
|
||||
base.OnEntering(last);
|
||||
|
||||
Background.FadeColour(Color4.DarkGray, 500);
|
||||
Beatmap.Value.Track?.Stop();
|
||||
resetTrack();
|
||||
}
|
||||
|
||||
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.Stop();
|
||||
}
|
||||
resetTrack();
|
||||
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
|
||||
private void resetTrack()
|
||||
{
|
||||
Beatmap.Value.Track?.ResetSpeedAdjustments();
|
||||
Beatmap.Value.Track?.Stop();
|
||||
}
|
||||
|
||||
private void exportBeatmap() => host.OpenFileExternally(Beatmap.Value.Save());
|
||||
|
||||
private void onModeChanged(ValueChangedEvent<EditorScreenMode> e)
|
||||
|
Loading…
Reference in New Issue
Block a user