Handle key counter rewinding in a better way

Use ElapsedFrameTime rather than storing state data
This commit is contained in:
Dean Herbert
2019-09-12 15:41:53 +09:00
parent cb0cf6e2c5
commit 0cdf125c1e
7 changed files with 50 additions and 84 deletions

View File

@ -137,9 +137,9 @@ namespace osu.Game.Rulesets.UI
{
}
public bool OnPressed(T action) => Target.Children.OfType<KeyCounterAction<T>>().Any(c => c.OnPressed(action));
public bool OnPressed(T action) => Target.Children.OfType<KeyCounterAction<T>>().Any(c => c.OnPressed(action, Clock.ElapsedFrameTime > 0));
public bool OnReleased(T action) => Target.Children.OfType<KeyCounterAction<T>>().Any(c => c.OnReleased(action));
public bool OnReleased(T action) => Target.Children.OfType<KeyCounterAction<T>>().Any(c => c.OnReleased(action, Clock.ElapsedFrameTime > 0));
}
#endregion