diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index bd7e51e937..75e273adea 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -23,6 +23,8 @@ protected RulesetInputManager(RulesetInfo ruleset, int variant, SimultaneousBind { } + #region Action mapping (for replays) + private List lastPressedActions = new List(); protected override void HandleNewState(InputState state) @@ -47,8 +49,9 @@ protected override void HandleNewState(InputState state) lastPressedActions = newActions; } - private ManualClock clock; - private IFrameBasedClock parentClock; + #endregion + + #region IHasReplayHandler private ReplayInputHandler replayInputHandler; public ReplayInputHandler ReplayInputHandler @@ -69,13 +72,12 @@ public ReplayInputHandler ReplayInputHandler } } - private Bindable mouseDisabled; + #endregion - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) - { - mouseDisabled = config.GetBindable(OsuSetting.MouseDisableButtons); - } + #region Clock control + + private ManualClock clock; + private IFrameBasedClock parentClock; protected override void LoadComplete() { @@ -152,6 +154,18 @@ protected override void Update() base.Update(); } + #endregion + + #region Setting application (disables etc.) + + private Bindable mouseDisabled; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + mouseDisabled = config.GetBindable(OsuSetting.MouseDisableButtons); + } + protected override void TransformState(InputState state) { base.TransformState(state); @@ -171,6 +185,10 @@ protected override void TransformState(InputState state) } } + #endregion + + #region Key Counter Attachment + public void Attach(KeyCounterCollection keyCounter) { var receptor = new ActionReceptor(keyCounter); @@ -191,13 +209,22 @@ public ActionReceptor(KeyCounterCollection target) public bool OnReleased(T action) => Target.Children.OfType>().Any(c => c.OnReleased(action)); } + + #endregion } + /// + /// Expose the in a capable . + /// public interface IHasReplayHandler { ReplayInputHandler ReplayInputHandler { get; set; } } + /// + /// Supports attaching a . + /// Keys will be populated automatically and a receptor will be injected inside. + /// public interface ICanAttachKeyCounter { void Attach(KeyCounterCollection keyCounter);