mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 23:59:16 +08:00
Fix key counter not updating activation state on initial load
This commit is contained in:
parent
bf2e0ed005
commit
b014bfea3e
@ -34,6 +34,11 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public IBindable<int> ActivationCount => activationCount;
|
public IBindable<int> ActivationCount => activationCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this <see cref="InputTrigger"/> is currently active.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsActive { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether any activation or deactivation of this <see cref="InputTrigger"/> impacts its <see cref="ActivationCount"/>
|
/// Whether any activation or deactivation of this <see cref="InputTrigger"/> impacts its <see cref="ActivationCount"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -49,6 +54,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
if (forwardPlayback && isCounting.Value)
|
if (forwardPlayback && isCounting.Value)
|
||||||
activationCount.Value++;
|
activationCount.Value++;
|
||||||
|
|
||||||
|
IsActive = true;
|
||||||
OnActivate?.Invoke(forwardPlayback);
|
OnActivate?.Invoke(forwardPlayback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,6 +63,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
if (!forwardPlayback && isCounting.Value)
|
if (!forwardPlayback && isCounting.Value)
|
||||||
activationCount.Value--;
|
activationCount.Value--;
|
||||||
|
|
||||||
|
IsActive = false;
|
||||||
OnDeactivate?.Invoke(forwardPlayback);
|
OnDeactivate?.Invoke(forwardPlayback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,14 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
Trigger.OnDeactivate += Deactivate;
|
Trigger.OnDeactivate += Deactivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
if (Trigger.IsActive)
|
||||||
|
Activate();
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual void Activate(bool forwardPlayback = true)
|
protected virtual void Activate(bool forwardPlayback = true)
|
||||||
{
|
{
|
||||||
isActive.Value = true;
|
isActive.Value = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user