From 740f6e5595b7890846da1eb0995ef9373e6f7a9e Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 30 Jan 2017 09:06:26 -0400 Subject: [PATCH] Moved delaying resuming to Player --- osu.Game/Overlays/Pause/PauseOverlay.cs | 4 ++-- osu.Game/Screens/Play/Player.cs | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Pause/PauseOverlay.cs b/osu.Game/Overlays/Pause/PauseOverlay.cs index 3055f032d5..e05be76927 100644 --- a/osu.Game/Overlays/Pause/PauseOverlay.cs +++ b/osu.Game/Overlays/Pause/PauseOverlay.cs @@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Pause case Key.Escape: if (State == Visibility.Hidden) return false; Hide(); - Task.Delay(transitionDuration * 2).ContinueWith(task => OnResume?.Invoke()); + OnResume?.Invoke(); return true; } return base.OnKeyDown(state, args); @@ -119,7 +119,7 @@ namespace osu.Game.Overlays.Pause Action = delegate { Hide(); - Task.Delay(transitionDuration * 2).ContinueWith(task => OnResume?.Invoke()); + OnResume?.Invoke(); } }, new RetryButton diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index cb3e2e489b..931764c2be 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -117,7 +117,14 @@ namespace osu.Game.Screens.Play scoreOverlay.BindProcessor(scoreProcessor = ruleset.CreateScoreProcessor(beatmap.HitObjects.Count)); pauseOverlay = new PauseOverlay { Depth = -1 }; - pauseOverlay.OnResume = Resume; + pauseOverlay.OnResume = delegate + { + Delay(400); + Schedule(() => + { + Resume(); + }); + }; pauseOverlay.OnRetry = Restart; pauseOverlay.OnQuit = Exit;