Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change key overlay to use the ordering provided by rulesets #26589

Merged
merged 3 commits into from Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Taiko/TaikoRuleset.cs
Expand Up @@ -69,11 +69,11 @@ public class TaikoRuleset : Ruleset, ILegacyRuleset

public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[]
{
new KeyBinding(InputKey.MouseLeft, TaikoAction.LeftCentre),
new KeyBinding(InputKey.MouseRight, TaikoAction.LeftRim),
new KeyBinding(InputKey.D, TaikoAction.LeftRim),
new KeyBinding(InputKey.F, TaikoAction.LeftCentre),
new KeyBinding(InputKey.MouseLeft, TaikoAction.LeftCentre),
new KeyBinding(InputKey.J, TaikoAction.RightCentre),
new KeyBinding(InputKey.MouseRight, TaikoAction.LeftRim),
Copy link
Collaborator

@bdach bdach Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this in this way causes revert-to-default buttons to appear in the settings overlay in the taiko section:

osu_2024-01-17_12-11-08

Something like the following:

diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs
index b80d8218f5..24b0ec5d57 100644
--- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs
+++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs
@@ -69,11 +69,11 @@ public class TaikoRuleset : Ruleset, ILegacyRuleset
 
         public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[]
         {
+            new KeyBinding(InputKey.MouseRight, TaikoAction.LeftRim),
             new KeyBinding(InputKey.D, TaikoAction.LeftRim),
-            new KeyBinding(InputKey.F, TaikoAction.LeftCentre),
             new KeyBinding(InputKey.MouseLeft, TaikoAction.LeftCentre),
+            new KeyBinding(InputKey.F, TaikoAction.LeftCentre),
             new KeyBinding(InputKey.J, TaikoAction.RightCentre),
-            new KeyBinding(InputKey.MouseRight, TaikoAction.LeftRim),
             new KeyBinding(InputKey.K, TaikoAction.RightRim),
         };
 

fixes that, without regressing #10545. Think it's worth it?

This would also fix the test failures, by the way.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a feeling that would be the case. I last minute reordered them for visual appeal without retesting.

Applying the change sounds fine.

new KeyBinding(InputKey.K, TaikoAction.RightRim),
};

Expand Down
1 change: 0 additions & 1 deletion osu.Game/Rulesets/UI/RulesetInputManager.cs
Expand Up @@ -167,7 +167,6 @@ public void Attach(InputCountController inputCountController)
var triggers = KeyBindingContainer.DefaultKeyBindings
.Select(b => b.GetAction<T>())
.Distinct()
.OrderBy(action => action)
.Select(action => new KeyCounterActionTrigger<T>(action))
.ToArray();

Expand Down