inv_ui: Allow disabling numeric map item shortcuts #62436
Closed
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
Interface "Allows disabling the numeric hotkeys for map items"
Purpose of change
Adds a new interface option for disabling numeric hotkeys in menus that interact with map items. These hotkeys take the numpad as input, and thus can easily lead to mistakes, as mentioned in #37980.
Describe the solution
Added a new setting, and then added an additional conditional to inventory_ui.cpp's inventory_selector::reassign_custom_invlets() that will cancel adding the shortcuts if that setting is false.
Describe alternatives you've considered
Adjusting inventory_ui to respect the key code setting, which would allow it to distinguish numpad keys from numeric keys. Alternately, allowing the alphabetical hotkeys to spill over to map items if there aren't enough items in the inventory to use up every letter. Both of these options seemed further beyond my scope and I wanted to keep it simple.
Testing
Started a new game as Evacuee, walked next to shelf with items, pressed 'w' to bring up wield menu. Numeric shortcuts are visible, and using the numpad wields an item. Went into options and turned "Use Numeric Item Shortcuts" to FALSE. Back in game, pressed 'w' to bring up wield menu. No numeric shortcuts are visible, and using the numpad navigates the menu. Turned the setting back to TRUE and the behavior went back to the default.
Additional context