mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 06:52:55 +08:00
Resolve "Pressing escape on continuing causes the game to return to song select" problem without removing Delay
This commit is contained in:
parent
77a8b36529
commit
a86a4f49cf
@ -36,6 +36,7 @@ namespace osu.Game.Screens.Play
|
||||
public int Retries { set { pauseOverlay.Retries = value; } }
|
||||
|
||||
public bool CanPause => (CheckCanPause?.Invoke() ?? true) && Time.Current >= lastPauseActionTime + pause_cooldown;
|
||||
public bool IsResuming { get; private set; }
|
||||
|
||||
public Action OnRetry;
|
||||
public Action OnQuit;
|
||||
@ -54,7 +55,11 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
AddInternal(pauseOverlay = new PauseOverlay
|
||||
{
|
||||
OnResume = () => Schedule(Resume),
|
||||
OnResume = () =>
|
||||
{
|
||||
IsResuming = true;
|
||||
this.Delay(400).Schedule(Resume);
|
||||
},
|
||||
OnRetry = () => OnRetry(),
|
||||
OnQuit = () => OnQuit(),
|
||||
});
|
||||
@ -100,6 +105,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
pauseOverlay.Hide();
|
||||
AudioClock.Start();
|
||||
IsResuming = false;
|
||||
}
|
||||
|
||||
private OsuGameBase game;
|
||||
|
@ -351,7 +351,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override bool OnExiting(Screen next)
|
||||
{
|
||||
if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false)
|
||||
if ((!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false) && (!pauseContainer?.IsResuming ?? false))
|
||||
{
|
||||
// In the case of replays, we may have changed the playback rate.
|
||||
applyRateFromMods();
|
||||
|
Loading…
Reference in New Issue
Block a user