From ad873b542a09334a86956be8b34249bce849b2f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 Jul 2019 00:22:40 +0900 Subject: [PATCH] Simplify editor logic --- osu.Game/Screens/Edit/Editor.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 310ce27d45..8cc227d9be 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -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 e)