mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:02:57 +08:00
Fix skip button getting stuck on screen for certain beatmaps
Closes #20034.
This commit is contained in:
parent
7ce1cf7560
commit
51346e0154
@ -114,16 +114,17 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
displayTime = gameplayClock.CurrentTime;
|
||||
|
||||
// skip is not required if there is no extra "empty" time to skip.
|
||||
// we may need to remove this if rewinding before the initial player load position becomes a thing.
|
||||
if (fadeOutBeginTime < gameplayClock.CurrentTime)
|
||||
if (fadeOutBeginTime <= displayTime)
|
||||
{
|
||||
Expire();
|
||||
return;
|
||||
}
|
||||
|
||||
button.Action = () => RequestSkip?.Invoke();
|
||||
displayTime = gameplayClock.CurrentTime;
|
||||
|
||||
fadeContainer.TriggerShow();
|
||||
|
||||
@ -146,7 +147,12 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
base.Update();
|
||||
|
||||
double progress = fadeOutBeginTime <= displayTime ? 1 : Math.Max(0, 1 - (gameplayClock.CurrentTime - displayTime) / (fadeOutBeginTime - displayTime));
|
||||
// This case causes an immediate expire in `LoadComplete`, but `Update` may run once after that.
|
||||
// Avoid div-by-zero below.
|
||||
if (fadeOutBeginTime <= displayTime)
|
||||
return;
|
||||
|
||||
double progress = Math.Max(0, 1 - (gameplayClock.CurrentTime - displayTime) / (fadeOutBeginTime - displayTime));
|
||||
|
||||
remainingTimeBox.Width = (float)Interpolation.Lerp(remainingTimeBox.Width, progress, Math.Clamp(Time.Elapsed / 40, 0, 1));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user