mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Fixed a bug where the user can double press escape to exit the song
This commit is contained in:
parent
bcd41a2c8f
commit
13da75f149
@ -55,6 +55,14 @@ namespace osu.Game.Screens.Play
|
|||||||
private double pauseCooldown = 1000;
|
private double pauseCooldown = 1000;
|
||||||
private double lastPauseActionTime = 0;
|
private double lastPauseActionTime = 0;
|
||||||
|
|
||||||
|
private bool canPause
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Time.Current >= (lastPauseActionTime + pauseCooldown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private IAdjustableClock sourceClock;
|
private IAdjustableClock sourceClock;
|
||||||
|
|
||||||
private Ruleset ruleset;
|
private Ruleset ruleset;
|
||||||
@ -155,7 +163,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public void Pause(bool force = false)
|
public void Pause(bool force = false)
|
||||||
{
|
{
|
||||||
if (Time.Current >= (lastPauseActionTime + pauseCooldown) || force)
|
if (canPause || force)
|
||||||
{
|
{
|
||||||
lastPauseActionTime = Time.Current;
|
lastPauseActionTime = Time.Current;
|
||||||
playerInputManager.PassThrough = true;
|
playerInputManager.PassThrough = true;
|
||||||
@ -259,6 +267,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected override bool OnExiting(GameMode next)
|
protected override bool OnExiting(GameMode next)
|
||||||
{
|
{
|
||||||
|
if (!canPause) return true;
|
||||||
|
|
||||||
if (!IsPaused && sourceClock.IsRunning) // For if the user presses escape quickly when entering the map
|
if (!IsPaused && sourceClock.IsRunning) // For if the user presses escape quickly when entering the map
|
||||||
{
|
{
|
||||||
Pause();
|
Pause();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user