diff --git a/osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs b/osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs
index 8347d255fa..3b18e41f30 100644
--- a/osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs
+++ b/osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs
@@ -38,9 +38,10 @@ namespace osu.Game.Rulesets.Osu.UI
});
}
- public override void Show()
+ protected override void PopIn()
{
- base.Show();
+ base.PopIn();
+
GameplayCursor.ActiveCursor.Hide();
cursorScaleContainer.MoveTo(GameplayCursor.ActiveCursor.Position);
clickToResumeCursor.Appear();
@@ -55,13 +56,13 @@ namespace osu.Game.Rulesets.Osu.UI
}
}
- public override void Hide()
+ protected override void PopOut()
{
+ base.PopOut();
+
localCursorContainer?.Expire();
localCursorContainer = null;
- GameplayCursor.ActiveCursor.Show();
-
- base.Hide();
+ GameplayCursor?.ActiveCursor?.Show();
}
protected override bool OnHover(HoverEvent e) => true;
diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePause.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePause.cs
index 2df22df659..64022b2410 100644
--- a/osu.Game.Tests/Visual/Gameplay/TestScenePause.cs
+++ b/osu.Game.Tests/Visual/Gameplay/TestScenePause.cs
@@ -69,6 +69,24 @@ namespace osu.Game.Tests.Visual.Gameplay
confirmClockRunning(true);
}
+ [Test]
+ public void TestPauseWithResumeOverlay()
+ {
+ AddStep("move cursor to center", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.Centre));
+ AddUntilStep("wait for hitobjects", () => Player.ScoreProcessor.Health.Value < 1);
+
+ pauseAndConfirm();
+
+ resume();
+ confirmClockRunning(false);
+ confirmPauseOverlayShown(false);
+
+ pauseAndConfirm();
+
+ AddUntilStep("resume overlay is not active", () => Player.DrawableRuleset.ResumeOverlay.State.Value == Visibility.Hidden);
+ confirmPaused();
+ }
+
[Test]
public void TestResumeWithResumeOverlaySkipped()
{
diff --git a/osu.Game/Rulesets/UI/DrawableRuleset.cs b/osu.Game/Rulesets/UI/DrawableRuleset.cs
index d5b3df27df..e005eea831 100644
--- a/osu.Game/Rulesets/UI/DrawableRuleset.cs
+++ b/osu.Game/Rulesets/UI/DrawableRuleset.cs
@@ -239,6 +239,12 @@ namespace osu.Game.Rulesets.UI
continueResume();
}
+ public override void CancelResume()
+ {
+ // called if the user pauses while the resume overlay is open
+ ResumeOverlay?.Hide();
+ }
+
///
/// Creates and adds the visual representation of a to this .
///
@@ -453,6 +459,11 @@ namespace osu.Game.Rulesets.UI
/// The action to run when resuming is to be completed.
public abstract void RequestResume(Action continueResume);
+ ///
+ /// Invoked when the user requests to pause while the resume overlay is active.
+ ///
+ public abstract void CancelResume();
+
///
/// Create a for the associated ruleset and link with this
/// .
diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs
index 0b363eac4d..280ebca651 100644
--- a/osu.Game/Screens/Play/Player.cs
+++ b/osu.Game/Screens/Play/Player.cs
@@ -443,7 +443,12 @@ namespace osu.Game.Screens.Play
{
if (!canPause) return;
- IsResuming = false;
+ if (IsResuming)
+ {
+ DrawableRuleset.CancelResume();
+ IsResuming = false;
+ }
+
GameplayClockContainer.Stop();
PauseOverlay.Show();
lastPauseActionTime = GameplayClockContainer.GameplayClock.CurrentTime;