mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 07:33:20 +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();
|
||||
|
||||
if (skipQueued)
|
||||
{
|
||||
Scheduler.AddDelayed(() => button.TriggerClick(), 200);
|
||||
skipQueued = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Triggers an "automated" skip to happen as soon as available.
|
||||
/// </summary>
|
||||
public void SkipWhenReady()
|
||||
{
|
||||
if (IsLoaded)
|
||||
if (skipQueued) return;
|
||||
|
||||
skipQueued = true;
|
||||
attemptNextSkip();
|
||||
|
||||
void attemptNextSkip() => Scheduler.AddDelayed(() =>
|
||||
{
|
||||
if (!button.Enabled.Value)
|
||||
{
|
||||
skipQueued = false;
|
||||
return;
|
||||
}
|
||||
|
||||
button.TriggerClick();
|
||||
else
|
||||
skipQueued = true;
|
||||
attemptNextSkip();
|
||||
}, 200);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
Loading…
Reference in New Issue
Block a user