mirror of
https://github.com/ppy/osu
synced 2024-12-14 19:06:07 +00:00
Merge pull request #6093 from smoogipoo:fix-player-restart
Fix player not correctly restarting after an unpause
This commit is contained in:
commit
c4f9be5913
@ -160,6 +160,15 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
exitAndConfirm();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestRestartAfterResume()
|
||||
{
|
||||
pauseAndConfirm();
|
||||
resumeAndConfirm();
|
||||
restart();
|
||||
confirmExited();
|
||||
}
|
||||
|
||||
private void pauseAndConfirm()
|
||||
{
|
||||
pause();
|
||||
@ -198,6 +207,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddUntilStep("player exited", () => !Player.IsCurrentScreen());
|
||||
}
|
||||
|
||||
private void restart() => AddStep("restart", () => Player.Restart());
|
||||
private void pause() => AddStep("pause", () => Player.Pause());
|
||||
private void resume() => AddStep("resume", () => Player.Resume());
|
||||
|
||||
|
@ -502,15 +502,18 @@ namespace osu.Game.Screens.Play
|
||||
return true;
|
||||
}
|
||||
|
||||
if (pauseCooldownActive && !GameplayClockContainer.IsPaused.Value)
|
||||
// still want to block if we are within the cooldown period and not already paused.
|
||||
return true;
|
||||
|
||||
if (HasFailed && ValidForResume && !FailOverlay.IsPresent)
|
||||
// ValidForResume is false when restarting
|
||||
// ValidForResume is false when restarting
|
||||
if (ValidForResume)
|
||||
{
|
||||
failAnimation.FinishTransforms(true);
|
||||
return true;
|
||||
if (pauseCooldownActive && !GameplayClockContainer.IsPaused.Value)
|
||||
// still want to block if we are within the cooldown period and not already paused.
|
||||
return true;
|
||||
|
||||
if (HasFailed && !FailOverlay.IsPresent)
|
||||
{
|
||||
failAnimation.FinishTransforms(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
GameplayClockContainer.ResetLocalAdjustments();
|
||||
|
Loading…
Reference in New Issue
Block a user