feat(menu): allow freeing and binding Insert under mod-api (#2715) #2928
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2928
Loading…
Reference in a new issue
No description provided.
Delete branch "cfw34683/Longshot:feat/2715-rebind-menu-debug-keys"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #2715
Closes #1750
Summary
Adds an "F1 or Esc" (
menu_shortcut = 3) option to Menu shortcut so players can keepEscas the pause/menu shortcut while freeingInsertfor gameplay keybinds or external overlays (such as ReShade).Changes:
game/mods/interface/mod.toml&game/mods/menu/strings/*.json: added"F1 or Esc"(menu_shortcut = 3) to Menu shortcut, translated across all 13 menu languages.game/crates/key-names/src/lib.rs: addedInsert(0x2D) toNAMEDsoKeybindcan bind and displayInsertonce freed (Homeis already free/bindable undermod-api;Deleteremains reserved byKeybindto clear bindings).gpu/vk/vk_menu.h,gpu/vk/vk_menu.cpp,gpu/vk/vk_ui.cpp: addedmenu_shortcut_uses_insert(int v)andmenu_shortcut_uses_esc(int v)soVK_INSERTis only reserved for the menu whenmenu_shortcutuses it (0or2), and forwarded toKeybindviaui_hearswhenmenu_shortcutisF1 only(1) orF1 or Esc(3).tests/test_menu_keys.py,tests/test_ui_debug_key.py,tests/test_ui_stale_keys.py: updatedmenu_shortcut/esc_openschecks and addedui_hearstests verifyingVK_INSERTis reserved onmenu_shortcut = 2and forwarded onmenu_shortcut = 3.Testing
Tested:
kokiri-startsave, rebased ontomain7bc53f841, head4e15e415a):python -I scripts/dev.py smoke: PASS (in play from kokiri-start, 900 frames, the menu opened, zeroFATAL:lines).LONGSHOT_SET=system/skip-title:skip_title_screen=1,system/interface:menu_shortcut=3,RX_VK_SHOT_MENU=1):Insertdoes not open the menu (menu_open=False), freeingInsert.F1opens (menu_open=True, hosted=system/menu) and closes (menu_open=False) the menu.Escopens the menu (menu_open=True, hosted=system/menu).FATAL:/ unhandled exception lines inlongshot_log.txt.python -I -B tests/run_all.py --exact tests/test_menu_keys.py tests/test_menu_ini_keys.py tests/test_i18n_complete.py tests/test_ui_debug_key.py tests/test_ui_stale_keys.py— 5 passed, 0 failed, 0 skipped.cargo test -p key-names— 2 passed, 0 failed.Still to test:
Insertno longer opens the menu and can be bound in a Keybind row whileF1andEscstill open/close the menu (@Beanstalk/ by hand).Measurements
Verdict: No performance impact (a single integer comparison on menu/UI key dispatch; nothing to measure).
Risks
menu_shortcutvalues (0,1,2) retain identical behavior; only the new opt-in value3("F1 or Esc") freesInsert.menu_shortcutsetting after updating.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (5 targeted menu/i18n/UI key checks +cargo test -p key-namespass on4e15e415a).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Possibly related, for context:
BTW this menu is completely re-written in the
mod-apibranch@HumanBean Thanks for the heads-up! Would you like me to implement this on the
mod-apibranch as well (updatinggame/mods/interface/mod.toml,settings_abi, andgpu/vk/vk_menu.cpp), or keep this PR targetingmain?79394cf7a7047d3f3c7a047d3f3c7a6b53be3e6f6b53be3e6f71f6306b7171f6306b7147f5a6235dfeat(menu): allow freeing and binding Insert, Home and Delete (#2715)to feat(menu): allow freeing and binding Insert under mod-api (#2715)addb1af3774e15e415ab4e15e415ab96b49fef71View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.