mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Make ActionListener
and KeysPerSecondCalculator
not rely on events to add timestamps
This commit is contained in:
@ -193,7 +193,7 @@ namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
if (calculator == null) return;
|
||||
|
||||
var listener = new ActionListener();
|
||||
var listener = new ActionListener(calculator);
|
||||
|
||||
KeyBindingContainer.Add(listener);
|
||||
|
||||
@ -202,11 +202,9 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
public class ActionListener : KeysPerSecondCalculator.InputListener, IKeyBindingHandler<T>
|
||||
{
|
||||
public override event Action OnNewInput;
|
||||
|
||||
public bool OnPressed(KeyBindingPressEvent<T> e)
|
||||
{
|
||||
OnNewInput?.Invoke();
|
||||
Calculator.AddTimestamp();
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -214,6 +212,11 @@ namespace osu.Game.Rulesets.UI
|
||||
public void OnReleased(KeyBindingReleaseEvent<T> e)
|
||||
{
|
||||
}
|
||||
|
||||
public ActionListener(KeysPerSecondCalculator calculator)
|
||||
: base(calculator)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
Reference in New Issue
Block a user