Add gamepad snap navigation to Generic Mod Config Menu - #561
Open
sonofskywalker3 wants to merge 2 commits into
Open
Add gamepad snap navigation to Generic Mod Config Menu#561sonofskywalker3 wants to merge 2 commits into
sonofskywalker3 wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds D-pad/thumbstick snap navigation for controller users in GMCM config menus, as discussed in #560.
Game1.options.gamepadControlsis true AND the toggle is enabledSnapCursorToDropdownItem()setsGamepadNavigated = trueevery frame while open, preventingDropdown.Update()mouse hit-test from fighting with the gamepad selectionAlso removes the Android-only skips for
SButton/KeybindListkeybind options (they now display on all platforms) and enables tooltips on Android.Key files
shared/SpaceShared/UI/TableNavigator.csshared/SpaceShared/UI/Table.csRowDataproperty for navigator accessshared/SpaceShared/UI/Dropdown.csGamepadNavigatedflag to prevent mouse overwriteframework/GenericModConfigMenu/Framework/OwnModConfig.csSnapNavigationsettingframework/GenericModConfigMenu/Mod.csframework/GenericModConfigMenu/Framework/ModConfigMenu.csframework/GenericModConfigMenu/Framework/SpecificModConfigMenu.csframework/GenericModConfigMenu/i18n/default.jsonTest plan
🤖 Generated with Claude Code