Controls: which button and key press each Switch button, from the options file #335
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!335
Loading…
Reference in a new issue
No description provided.
Delete branch "input/bindings"
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?
Part of splitting #83 into small PRs. This is the first of three. The next two, which build on it, let the Insert menu be driven from a controller and add a Controls page to rebind from inside the game.
The gamepad buttons and the keys were fixed tables in
nn_hid.candpad_sdl.c. They are now one table: each Switch button has a gamepad input (by position) and up to two keys.hookshot_options.inican set them withpad_<button>=<position>andkey_<button>=<key code>,<key code>. A button it leaves out keeps today's default, so nothing changes without those lines.HOS_PAD_*, SDL's order). The table turns them into the Switch's buttons.pad_andkey_lines. Before, it rewrote the whole file.Tested on Linux (game built from this branch, a copy of real saves):
key_a=71(G) inhookshot_options.ini, the log sayshid: 1 controls from hookshot_options.ini. On the title screen, E (A's default key) does nothing and G opens the Load screen.key_a=71.tests/gives the same result as on main (the 4test_cpp_preflightchecks need Visual Studio).Merge notes: #324 moves
hookshot_options.ininext to the saves; whichever lands second changesbinds_loadto usehos_options_path(). #328 rewritespad_sdl.cfor the SDL stubs, and the loop that reads the buttons conflicts in a small way.🤖 Generated with Claude Code
@NotRexed rebased on current main (
9e8fb5b).