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

inv_ui: Allow disabling numeric map item shortcuts #62436

Closed
wants to merge 3 commits into from

Conversation

Kamayana
Copy link
Contributor

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

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. labels Nov 27, 2022
src/inventory_ui.cpp Outdated Show resolved Hide resolved
src/options.cpp Outdated Show resolved Hide resolved
Kamayana and others added 2 commits November 27, 2022 12:27
Fixing whitespacing.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fix overly long line.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Kamayana Kamayana closed this Nov 27, 2022
@Kamayana Kamayana deleted the AIM_containerFix branch November 27, 2022 20:37
@Kamayana Kamayana restored the AIM_containerFix branch November 27, 2022 20:41
@Kamayana Kamayana deleted the AIM_containerFix branch November 27, 2022 20:41
@Kamayana
Copy link
Contributor Author

Whoops, I'm a doofus. Pardon my git rust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant