mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Adjust auto-skip to skip multiple times if necessary
This commit is contained in:
parent
5f2f6b84b2
commit
4154be6cda
@ -136,20 +136,29 @@ namespace osu.Game.Screens.Play
|
|||||||
};
|
};
|
||||||
|
|
||||||
fadeContainer.TriggerShow();
|
fadeContainer.TriggerShow();
|
||||||
|
|
||||||
if (skipQueued)
|
|
||||||
{
|
|
||||||
Scheduler.AddDelayed(() => button.TriggerClick(), 200);
|
|
||||||
skipQueued = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Triggers an "automated" skip to happen as soon as available.
|
||||||
|
/// </summary>
|
||||||
public void SkipWhenReady()
|
public void SkipWhenReady()
|
||||||
{
|
{
|
||||||
if (IsLoaded)
|
if (skipQueued) return;
|
||||||
|
|
||||||
|
skipQueued = true;
|
||||||
|
attemptNextSkip();
|
||||||
|
|
||||||
|
void attemptNextSkip() => Scheduler.AddDelayed(() =>
|
||||||
|
{
|
||||||
|
if (!button.Enabled.Value)
|
||||||
|
{
|
||||||
|
skipQueued = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
button.TriggerClick();
|
button.TriggerClick();
|
||||||
else
|
attemptNextSkip();
|
||||||
skipQueued = true;
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
Loading…
Reference in New Issue
Block a user