Skip to content

Add gamepad snap navigation to Generic Mod Config Menu - #561

Open
sonofskywalker3 wants to merge 2 commits into
spacechase0:developfrom
sonofskywalker3:gmcm-gamepad-snap-navigation
Open

Add gamepad snap navigation to Generic Mod Config Menu#561
sonofskywalker3 wants to merge 2 commits into
spacechase0:developfrom
sonofskywalker3:gmcm-gamepad-snap-navigation

Conversation

@sonofskywalker3

@sonofskywalker3 sonofskywalker3 commented Feb 20, 2026

Copy link
Copy Markdown

Summary

Adds D-pad/thumbstick snap navigation for controller users in GMCM config menus, as discussed in #560.

  • D-pad/left stick navigates between interactive options (with hold-to-repeat)
  • D-pad left/right adjusts sliders
  • D-pad up/down inside dropdowns cycles choices
  • A button clicks focused elements (checkboxes, buttons, dropdowns)
  • B button navigates back (dropdown → table → mod list → close)
  • Bottom buttons (Cancel/Reset/Save/Save&Close) reachable via D-pad
  • "Snap navigation" toggle in GMCM's own settings — users can disable to fall back to free cursor
  • Only activates when Game1.options.gamepadControls is true AND the toggle is enabled
  • Mouse/keyboard behavior completely unaffected
  • Dropdown flicker fix: SnapCursorToDropdownItem() sets GamepadNavigated = true every frame while open, preventing Dropdown.Update() mouse hit-test from fighting with the gamepad selection

Also removes the Android-only skips for SButton/KeybindList keybind options (they now display on all platforms) and enables tooltips on Android.

Key files

File Change
shared/SpaceShared/UI/TableNavigator.cs New — snap navigation engine (540 lines)
shared/SpaceShared/UI/Table.cs Add RowData property for navigator access
shared/SpaceShared/UI/Dropdown.cs Add GamepadNavigated flag to prevent mouse overwrite
framework/GenericModConfigMenu/Framework/OwnModConfig.cs Add SnapNavigation setting
framework/GenericModConfigMenu/Mod.cs Config toggle, focus restoration, viewport fixes
framework/GenericModConfigMenu/Framework/ModConfigMenu.cs Navigator integration
framework/GenericModConfigMenu/Framework/SpecificModConfigMenu.cs Navigator integration
framework/GenericModConfigMenu/i18n/default.json Translation strings

Test plan

  • PC with Xbox controller — snap navigation works in mod list and mod config pages
  • PC with mouse — no behavior changes, mouse works normally
  • Snap navigation toggle appears in GMCM's own settings
  • Toggle persists across sessions (saved to config.json)
  • B button back-navigation: dropdown → table → mod list → close
  • Slider adjustment with D-pad left/right
  • Dropdown navigation with D-pad up/down
  • Bottom buttons reachable and navigable
  • Android devices (Ayaneo Pocket Air Mini, Odin Pro)
  • Dropdown cursor flicker fixed — no more flickering between gamepad and mouse selections

🤖 Generated with Claude Code

Jeff Moore and others added 2 commits February 20, 2026 15:31
Adds D-pad and thumbstick snap navigation for controller users in
GMCM config menus. When gamepadControls is enabled, users can:

- Navigate between options with D-pad/left stick (with hold-to-repeat)
- Adjust sliders with D-pad left/right
- Cycle through dropdown choices with D-pad up/down
- Press A to click focused elements (checkboxes, buttons, dropdowns)
- Press B to go back (dropdown → table → mod list → close)
- Navigate bottom buttons (Cancel/Reset/Save/Save&Close)

A "Snap navigation" toggle in GMCM's own settings lets users disable
this and fall back to the free cursor. Defaults to enabled.

Key changes:
- New: shared/SpaceShared/UI/TableNavigator.cs (snap navigation engine)
- New: Table.RowData property for navigator row access
- New: Dropdown.GamepadNavigated flag to prevent mouse overwrite
- New: OwnModConfig.SnapNavigation setting with GMCM self-config toggle
- Modified: ModConfigMenu.cs + SpecificModConfigMenu.cs (navigator integration)
- Modified: Mod.cs (focus restoration, viewport fixes, config toggle)
- Removed: Android-only skips for SButton/KeybindList keybind options
- Removed: Android-only tooltip suppression (tooltips now show on all platforms)

Tested on PC (Windows 11, Xbox controller) and Android (multiple devices).
Mouse/keyboard behavior is completely unaffected.

Closes spacechase0#560

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SnapCursorToDropdownItem() now sets GamepadNavigated = true every frame
while a dropdown is open, not just on the frame when D-pad is pressed.
Without this, Dropdown.Update() mouse hit-test runs on frames between
D-pad presses and picks a different choice based on stale getOldMouseY(),
causing visible cursor flicker between the gamepad-selected and
mouse-detected items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant