mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Fix Alt-F4 being blocked during gameplay (#6369)
Fix Alt-F4 being blocked during gameplay Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
@ -127,14 +127,47 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
exitAndConfirm();
|
exitAndConfirm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestExitFromFailedGameplay()
|
||||||
|
{
|
||||||
|
AddUntilStep("wait for fail", () => Player.HasFailed);
|
||||||
|
AddStep("exit", () => Player.Exit());
|
||||||
|
|
||||||
|
confirmExited();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestQuickRetryFromFailedGameplay()
|
||||||
|
{
|
||||||
|
AddUntilStep("wait for fail", () => Player.HasFailed);
|
||||||
|
AddStep("quick retry", () => Player.GameplayClockContainer.OfType<HotkeyRetryOverlay>().First().Action?.Invoke());
|
||||||
|
|
||||||
|
confirmExited();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestQuickExitFromFailedGameplay()
|
||||||
|
{
|
||||||
|
AddUntilStep("wait for fail", () => Player.HasFailed);
|
||||||
|
AddStep("quick exit", () => Player.GameplayClockContainer.OfType<HotkeyExitOverlay>().First().Action?.Invoke());
|
||||||
|
|
||||||
|
confirmExited();
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExitFromGameplay()
|
public void TestExitFromGameplay()
|
||||||
{
|
{
|
||||||
AddStep("exit", () => Player.Exit());
|
AddStep("exit", () => Player.Exit());
|
||||||
|
|
||||||
confirmPaused();
|
confirmExited();
|
||||||
|
}
|
||||||
|
|
||||||
exitAndConfirm();
|
[Test]
|
||||||
|
public void TestQuickExitFromGameplay()
|
||||||
|
{
|
||||||
|
AddStep("quick exit", () => Player.GameplayClockContainer.OfType<HotkeyExitOverlay>().First().Action?.Invoke());
|
||||||
|
|
||||||
|
confirmExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -299,7 +299,16 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
if (!this.IsCurrentScreen()) return;
|
if (!this.IsCurrentScreen()) return;
|
||||||
|
|
||||||
this.Exit();
|
if (ValidForResume && HasFailed && !FailOverlay.IsPresent)
|
||||||
|
{
|
||||||
|
failAnimation.FinishTransforms(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canPause)
|
||||||
|
Pause();
|
||||||
|
else
|
||||||
|
this.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Restart()
|
public void Restart()
|
||||||
@ -508,24 +517,12 @@ namespace osu.Game.Screens.Play
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canPause)
|
|
||||||
{
|
|
||||||
Pause();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidForResume is false when restarting
|
// ValidForResume is false when restarting
|
||||||
if (ValidForResume)
|
if (ValidForResume)
|
||||||
{
|
{
|
||||||
if (pauseCooldownActive && !GameplayClockContainer.IsPaused.Value)
|
if (pauseCooldownActive && !GameplayClockContainer.IsPaused.Value)
|
||||||
// still want to block if we are within the cooldown period and not already paused.
|
// still want to block if we are within the cooldown period and not already paused.
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (HasFailed && !FailOverlay.IsPresent)
|
|
||||||
{
|
|
||||||
failAnimation.FinishTransforms(true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GameplayClockContainer.ResetLocalAdjustments();
|
GameplayClockContainer.ResetLocalAdjustments();
|
||||||
|
Reference in New Issue
Block a user