1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 09:27:34 +08:00

Make player block exit if pausable (#6992)

Make player block exit if pausable

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-12-05 01:39:52 +09:00 committed by GitHub
commit 5c1305a3e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -113,11 +113,11 @@ namespace osu.Game.Tests.Visual.Gameplay
}
[Test]
[Ignore("Will be resolved with merge of https://github.com/ppy/osu/pull/6992")]
public void TestExitTooSoon()
{
pauseAndConfirm();
AddStep("seek before gameplay", () => Player.GameplayClockContainer.Seek(-5000));
pauseAndConfirm();
resume();
AddStep("exit too soon", () => Player.Exit());
@ -177,7 +177,9 @@ namespace osu.Game.Tests.Visual.Gameplay
public void TestExitFromGameplay()
{
AddStep("exit", () => Player.Exit());
confirmPaused();
AddStep("exit", () => Player.Exit());
confirmExited();
}
@ -213,9 +215,10 @@ namespace osu.Game.Tests.Visual.Gameplay
}
[Test]
[Ignore("Will be resolved with merge of https://github.com/ppy/osu/pull/6992")]
public void TestRestartAfterResume()
{
AddStep("seek before gameplay", () => Player.GameplayClockContainer.Seek(-5000));
pauseAndConfirm();
resumeAndConfirm();
restart();

View File

@ -536,6 +536,12 @@ namespace osu.Game.Screens.Play
return true;
}
if (canPause)
{
Pause();
return true;
}
// GameplayClockContainer performs seeks / start / stop operations on the beatmap's track.
// as we are no longer the current screen, we cannot guarantee the track is still usable.
GameplayClockContainer.StopUsingBeatmapClock();