From bb6491e42cf75853ef407e794fa89026a18ce415 Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Mon, 21 Oct 2024 10:13:07 +0200 Subject: [PATCH] Remove button input mode It's not the ideal mode anyways --- .../Configuration/LaneInputMode.cs | 14 ----------- .../SentakkiRulesetConfigManager.cs | 2 -- .../SentakkiFramedReplayInputHandler.cs | 1 - .../Replays/SentakkiReplayFrame.cs | 7 +----- .../UI/DrawableSentakkiRuleset.cs | 7 ------ osu.Game.Rulesets.Sentakki/UI/Lane.cs | 25 ++----------------- .../UI/SentakkiReplayRecorder.cs | 2 +- .../UI/SentakkiSettingsSubsection.cs | 5 ---- 8 files changed, 4 insertions(+), 59 deletions(-) delete mode 100644 osu.Game.Rulesets.Sentakki/Configuration/LaneInputMode.cs diff --git a/osu.Game.Rulesets.Sentakki/Configuration/LaneInputMode.cs b/osu.Game.Rulesets.Sentakki/Configuration/LaneInputMode.cs deleted file mode 100644 index 3928c1593..000000000 --- a/osu.Game.Rulesets.Sentakki/Configuration/LaneInputMode.cs +++ /dev/null @@ -1,14 +0,0 @@ -using osu.Framework.Localisation; -using osu.Game.Rulesets.Sentakki.Localisation; - -namespace osu.Game.Rulesets.Sentakki.Configuration -{ - public enum LaneInputMode - { - [LocalisableDescription(typeof(SentakkiSettingsSubsectionStrings), nameof(SentakkiSettingsSubsectionStrings.LaneInputModeButton))] - Button, - - [LocalisableDescription(typeof(SentakkiSettingsSubsectionStrings), nameof(SentakkiSettingsSubsectionStrings.LaneInputModeSensor))] - Sensor, - } -} diff --git a/osu.Game.Rulesets.Sentakki/Configuration/SentakkiRulesetConfigManager.cs b/osu.Game.Rulesets.Sentakki/Configuration/SentakkiRulesetConfigManager.cs index a21cf1281..b22695dec 100644 --- a/osu.Game.Rulesets.Sentakki/Configuration/SentakkiRulesetConfigManager.cs +++ b/osu.Game.Rulesets.Sentakki/Configuration/SentakkiRulesetConfigManager.cs @@ -23,7 +23,6 @@ protected override void InitialiseDefaults() SetDefault(SentakkiRulesetSettings.ShowNoteStartIndicators, false); SetDefault(SentakkiRulesetSettings.RingColor, ColorOption.Default); SetDefault(SentakkiRulesetSettings.RingOpacity, 1f, 0f, 1f, 0.01f); - SetDefault(SentakkiRulesetSettings.LaneInputMode, LaneInputMode.Button); SetDefault(SentakkiRulesetSettings.SnakingSlideBody, true); SetDefault(SentakkiRulesetSettings.DetailedJudgements, false); } @@ -46,7 +45,6 @@ public enum SentakkiRulesetSettings ShowNoteStartIndicators, RingColor, TouchAnimationSpeed, - LaneInputMode, SnakingSlideBody, DetailedJudgements, } diff --git a/osu.Game.Rulesets.Sentakki/Replays/SentakkiFramedReplayInputHandler.cs b/osu.Game.Rulesets.Sentakki/Replays/SentakkiFramedReplayInputHandler.cs index 8b80d66cf..73c3af776 100644 --- a/osu.Game.Rulesets.Sentakki/Replays/SentakkiFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Sentakki/Replays/SentakkiFramedReplayInputHandler.cs @@ -15,7 +15,6 @@ public SentakkiFramedReplayInputHandler(Replay replay) } protected override bool IsImportant(SentakkiReplayFrame frame) => true; - public bool UsingSensorMode => CurrentFrame?.UsingSensorMode ?? false; protected Vector2 Position { diff --git a/osu.Game.Rulesets.Sentakki/Replays/SentakkiReplayFrame.cs b/osu.Game.Rulesets.Sentakki/Replays/SentakkiReplayFrame.cs index 3def4a468..b007913da 100644 --- a/osu.Game.Rulesets.Sentakki/Replays/SentakkiReplayFrame.cs +++ b/osu.Game.Rulesets.Sentakki/Replays/SentakkiReplayFrame.cs @@ -12,18 +12,16 @@ public class SentakkiReplayFrame : ReplayFrame, IConvertibleReplayFrame { public Vector2 Position; public List Actions = new List(); - public bool UsingSensorMode; public SentakkiReplayFrame() { } - public SentakkiReplayFrame(double time, Vector2 position, bool usingSensorMode, IEnumerable actions) + public SentakkiReplayFrame(double time, Vector2 position, IEnumerable actions) : base(time) { Position = position; Actions.AddRange(actions); - UsingSensorMode = usingSensorMode; } public void FromLegacy(LegacyReplayFrame currentFrame, IBeatmap beatmap, ReplayFrame? lastFrame = null) @@ -32,8 +30,6 @@ public void FromLegacy(LegacyReplayFrame currentFrame, IBeatmap beatmap, ReplayF if (currentFrame.MouseLeft) Actions.Add(SentakkiAction.Button1); if (currentFrame.MouseRight) Actions.Add(SentakkiAction.Button2); - - UsingSensorMode = currentFrame.ButtonState.HasFlag(ReplayButtonState.Smoke); } public LegacyReplayFrame ToLegacy(IBeatmap beatmap) @@ -42,7 +38,6 @@ public LegacyReplayFrame ToLegacy(IBeatmap beatmap) if (Actions.Contains(SentakkiAction.Button1)) state |= ReplayButtonState.Left1; if (Actions.Contains(SentakkiAction.Button2)) state |= ReplayButtonState.Right1; - if (UsingSensorMode) state |= ReplayButtonState.Smoke; return new LegacyReplayFrame(Time, Position.X, Position.Y, state); } diff --git a/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs b/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs index 9045027f3..8e83bef2e 100644 --- a/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs +++ b/osu.Game.Rulesets.Sentakki/UI/DrawableSentakkiRuleset.cs @@ -50,8 +50,6 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl [BackgroundDependencyLoader] private void load() { - Config.BindWith(SentakkiRulesetSettings.LaneInputMode, laneInputMode); - FrameStableComponents.Add(slideFanChevronsTextures); Config.BindWith(SentakkiRulesetSettings.AnimationSpeed, configEntrySpeed); @@ -140,13 +138,8 @@ public void OnReleased(KeyBindingReleaseEvent e) { } protected new SentakkiRulesetConfigManager Config => (SentakkiRulesetConfigManager)base.Config; - // Input specifics (sensor/button) for replay and gameplay - private readonly Bindable laneInputMode = new Bindable(); - private SentakkiFramedReplayInputHandler? sentakkiFramedReplayInput => (SentakkiFramedReplayInputHandler?)((SentakkiInputManager)KeyBindingInputManager).ReplayInputHandler; - public bool UseSensorMode => sentakkiFramedReplayInput is not null ? sentakkiFramedReplayInput.UsingSensorMode : laneInputMode.Value == LaneInputMode.Sensor; - // Default stuff protected override Playfield CreatePlayfield() => new SentakkiPlayfield(); diff --git a/osu.Game.Rulesets.Sentakki/UI/Lane.cs b/osu.Game.Rulesets.Sentakki/UI/Lane.cs index 62ff472ff..7b9667e99 100644 --- a/osu.Game.Rulesets.Sentakki/UI/Lane.cs +++ b/osu.Game.Rulesets.Sentakki/UI/Lane.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Sentakki.UI { - public partial class Lane : Playfield, IKeyBindingHandler + public partial class Lane : Playfield { public int LaneNumber { get; set; } @@ -91,8 +91,6 @@ public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) private readonly BindableInt currentKeys = new BindableInt(); - private bool usingSensor => drawableSentakkiRuleset.UseSensorMode; - private readonly Dictionary buttonTriggerState = new Dictionary(); private void updateInputState() @@ -114,7 +112,7 @@ private void updateInputState() } // We don't attempt to check mouse input if touch input is used - if (count == 0 && IsHovered && usingSensor) + if (count == 0 && IsHovered) { foreach (var a in SentakkiActionInputManager.PressedActions) { @@ -141,25 +139,6 @@ private void handleKeyPress(ValueChangedEvent keys) } } - public bool OnPressed(KeyBindingPressEvent e) - { - if (usingSensor) return false; - - if (e.Action >= SentakkiAction.Key1 || !IsHovered) return false; - - buttonTriggerState[e.Action] = true; - return false; - } - - public void OnReleased(KeyBindingReleaseEvent e) - { - if (usingSensor) return; - - if (e.Action >= SentakkiAction.Key1) return; - - buttonTriggerState[e.Action] = false; - } - #endregion } } diff --git a/osu.Game.Rulesets.Sentakki/UI/SentakkiReplayRecorder.cs b/osu.Game.Rulesets.Sentakki/UI/SentakkiReplayRecorder.cs index a4e92b2e0..efa0cb3ee 100644 --- a/osu.Game.Rulesets.Sentakki/UI/SentakkiReplayRecorder.cs +++ b/osu.Game.Rulesets.Sentakki/UI/SentakkiReplayRecorder.cs @@ -18,6 +18,6 @@ public SentakkiReplayRecorder(Score score, DrawableSentakkiRuleset ruleset) } protected override ReplayFrame HandleFrame(Vector2 mousePosition, List actions, ReplayFrame previousFrame) - => new SentakkiReplayFrame(Time.Current, mousePosition, drawableRuleset.UseSensorMode, actions); + => new SentakkiReplayFrame(Time.Current, mousePosition, actions); } } diff --git a/osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs b/osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs index f76f6c63c..34b28e908 100644 --- a/osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs +++ b/osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs @@ -69,11 +69,6 @@ private void load() KeyboardStep = 0.01f, DisplayAsPercentage = true }, - new SettingsEnumDropdown - { - LabelText = SentakkiSettingsSubsectionStrings.LaneInputMode, - Current = config.GetBindable(SentakkiRulesetSettings.LaneInputMode) - }, }; }