Allow using hotkeys to select spells in other categories #74281
Merged
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
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)