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

Allow using hotkeys to select spells in other categories #74281

Merged
merged 4 commits into from
Jun 4, 2024

Conversation

b3brodie
Copy link
Contributor

@b3brodie b3brodie commented Jun 3, 2024

Summary

Bugfixes "Allow using hotkeys to select spells in other categories"

Purpose of change

Fixes #72849
Currently you can only hotkey select spells within the visible spell category (eg when tabbed to magus only magus spells have functional hotkeys).
Since #72643 defaults the spellcasting tab to the favorites category, this means that you cannot use hotkeys to select non-favorite spells without manually switching back to the all category.
The expected usecase for spell hotkeys, eg open spellcasting menu then press hotkey to cast spell, doesn't currently work due to the interplay of these two factors. In #73237 a solution to fix this was to revert the change to default to the favorites tab, but this solution can keep the favorites tab automatically selected while also not breaking hotkeys.

Describe the solution

Alter the UI query method to allow hotkeys to ignore the filtered list of options with an optional parameter, and give said parameter to the spellcasting menu query.

Describe alternatives you've considered

#73237 would be easier, but this option keeps the favorites tab default which does have a good use case while also allowing the expected hotkey use.

Testing

Able to cast spells using hotkeys outside of their category section
Tested both favorites, classless, and class categories to ensure that hotkeys work for all
Using an unassigned hotkey does nothing
Cannot cast invalid spell with hotkey (eg cannot cast spell with hotkey when character has no mana)

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` labels Jun 3, 2024
@github-actions github-actions bot requested a review from KorGgenT June 3, 2024 06:58
src/magic.cpp Outdated Show resolved Hide resolved
src/ui.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jun 3, 2024
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs labels Jun 3, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 4, 2024
@Maleclypse Maleclypse merged commit 9ec3053 into CleverRaven:master Jun 4, 2024
22 of 26 checks passed
@b3brodie b3brodie deleted the hotkey_favorite branch June 4, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

revert #72643 as discussed with its author on discord
2 participants