mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Make player block exit if pausable
This commit is contained in:
@ -115,8 +115,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestExitTooSoon()
|
public void TestExitTooSoon()
|
||||||
{
|
{
|
||||||
pauseAndConfirm();
|
AddStep("seek before gameplay", () => Player.GameplayClockContainer.Seek(-5000));
|
||||||
|
|
||||||
|
pauseAndConfirm();
|
||||||
resume();
|
resume();
|
||||||
|
|
||||||
AddStep("exit too soon", () => Player.Exit());
|
AddStep("exit too soon", () => Player.Exit());
|
||||||
@ -176,7 +177,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
public void TestExitFromGameplay()
|
public void TestExitFromGameplay()
|
||||||
{
|
{
|
||||||
AddStep("exit", () => Player.Exit());
|
AddStep("exit", () => Player.Exit());
|
||||||
|
confirmPaused();
|
||||||
|
|
||||||
|
AddStep("exit", () => Player.Exit());
|
||||||
confirmExited();
|
confirmExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,6 +217,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestRestartAfterResume()
|
public void TestRestartAfterResume()
|
||||||
{
|
{
|
||||||
|
AddStep("seek before gameplay", () => Player.GameplayClockContainer.Seek(-5000));
|
||||||
|
|
||||||
pauseAndConfirm();
|
pauseAndConfirm();
|
||||||
resumeAndConfirm();
|
resumeAndConfirm();
|
||||||
restart();
|
restart();
|
||||||
|
@ -536,6 +536,12 @@ namespace osu.Game.Screens.Play
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (canPause)
|
||||||
|
{
|
||||||
|
Pause();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// GameplayClockContainer performs seeks / start / stop operations on the beatmap's track.
|
// 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.
|
// as we are no longer the current screen, we cannot guarantee the track is still usable.
|
||||||
GameplayClockContainer.StopUsingBeatmapClock();
|
GameplayClockContainer.StopUsingBeatmapClock();
|
||||||
|
Reference in New Issue
Block a user