Repository navigation
feat(prompts): the keyboard face's ocarina notes and letters show the keys bound - #2755
polackangry wants to merge 1 commit into
Conversation
… keys bound On the Keyboard face the ocarina's notes and the white letters on black showed the Switch's A, L, R, X, Y. prompt_assets now writes prompts/keyboard/textures.bin from the keyboard face's own key icons, and prompts.c gives each Switch button its first key bound, so the notes follow the Controls page and the live switch of Button prompts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Joey-Magnus
left a comment
There was a problem hiding this comment.
I merged this into current main and ran test_prompt_skip, test_prompts_live, test_prompt_font_bind, test_prompt_auto_face, test_menu_hooks and test_release_prompt_packages. All pass. The appimage failure is the package-mirror timeout, not this change.
The host side is small and safe. host/prompts.c only picks the keyboard face's textures when prompts/keyboard/textures.bin exists. Without it, texture_face and texture_bind fall back to the Switch defaults as before, so an older build's output still works. first_key() already limits key codes to 1..0xFF, which fits the pad-input byte, and prompt_keys.KEYS runs 0x01..0xDE. prompt_keys.py is already in prompt_key(), so the #2698 skip key covers the new import. The test_prompt_skip change mirrors generate() rather than weakening the check.
Heads-up for the merge order: this and #2756 (and #2757) each add a row at the top of docs/tested-configurations.md, so whichever lands second needs a one-line rebase. The code in host/prompts.c merges cleanly with #2756, and I ran the prompt tests on the combination.
On the Keyboard face the ocarina's notes (the songbook, a song's staff) and the white letters on black still show the Switch's A, L, R, X, Y, so a player on the keyboard has to work out which key each note is. #2435 left the textures as the Switch's; this gives the keyboard face textures of its own.
What it does
How
nx2/prompt_assets.py:button_layers: the notes' and the letters' layers, cut out offace_layersunchanged, so the pad faces and the keyboard draw them the same way.hand_made: the hand-made overrides, cut out the same way.Icons.keys: each key's icon from the font just built (KEY_BASE + key code, the keyboard face's own glyphs from feat(prompts): a Keyboard face: the keys and mouse buttons bound, in texts, hints and menus #2435), for the 110 keysnx2/prompt_keys.pynames.keyboard_layers: those, for every key, intoprompts/keyboard/textures.bin, the key code in the entry's pad-input byte. The icons are drawn at the size of the game's own discs (KEYBOARD_SCALE): a key fills its square where a pad's round icon leaves the corners.textures.binare byte-identical to before (checked for Switch and Xbox).host/prompts.c: withprompts/keyboard/textures.binthere,texture_facekeeps the keyboard face's own textures andtexture_bindgives each Switch button its first key (bind[HOS_SW_N + b]), whichcurrent_bindsalready carries, so the live path needs no change.readme.md: the Button prompts entry.tests/test_prompt_skip.py: its stand-in generator writes the keyboard'stextures.binasgeneratenow does.prompts/keyboard/textures.binis 7.0 MB (Xbox's is 4.2 MB) and is made in about 6 s.Not in this PR: the ocarina's own note rows (#1930,
HOS_KEY_OC_NOTE_*). When a note has a key of its own, every face's prompts (the notes' textures, the ocarina hint, the icons in texts) still show the Switch button's control, as before. It's the same gap on every face, so it's better as its own change.Screenshots
The Song of Time in the songbook, the Keyboard face; the right one switched to Xbox with the songbook open. The "before" run had the default keys, the "after" runs the tester's own (I for A), so the letters differ.
Testing
In game, native Windows 11, RTX 5060 Ti, the v131072 game, a build of this branch on main (4678050), driven with the control bridge (headless), a save in the Fire Temple:
prompts: keyboard texturesat the start40 runs for this pad's controlsnow xbox textures: 2201 runs written, 40 put back)now keyboard textures: 40 runs written, 2201 put back)Tests:
test_prompt_skip,test_prompts_live,test_prompt_font_bind,test_prompt_auto_face,test_menu_hooks,test_prompt_guide_lines,test_appimage_prompt_fontsandtest_release_prompt_packagespass.tests/run_all.pyon this machine: 416 passed, 9 failed, 67 skipped. The 9 (nx2/test_nup_paths.py,test_builder_details_hitbox,test_builder_dlss_update,test_gpu_hang_watch,test_input_background,test_portable_archive,test_portable_builder_home,test_portable_builder_startup,test_updater_asset_digest) fail the same on main without this change: the builder's .NET, Windows symlinks and timing on this PC.The branch is rebased on main (51da046) after the run; the files it touches didn't change there, and the tests above pass on it again. A row for the run is in
docs/tested-configurations.md.🤖 Generated with Claude Code