Skip to content

feat(prompts): the keyboard face's ocarina notes and letters show the keys bound - #2755

Open
polackangry wants to merge 1 commit into
NotRexed:mainfrom
polackangry:feat/keyboard-ocarina-notes
Open

polackangry wants to merge 1 commit into
NotRexed:mainfrom
polackangry:feat/keyboard-ocarina-notes

Conversation

@polackangry

@polackangry polackangry commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Button prompts → Keyboard (or Auto with no controller): each note and letter shows the first key bound to its Switch button on the Controls page, the same key the texts and hints show. With the default keys the Song of Time reads E Q R E Q R instead of A L R A L R. Mouse buttons show as the mouse with that button lit, word keys (Ctrl, Del, Num0...) as the font's wider keys.
  • It follows the live system: changing a key, or switching to or from Keyboard, rewrites the notes at once, the songbook open included.
  • A key the keyboard textures have no image for, and a button with no key, shows the game's own letter, as before. A build without the keyboard textures behaves as before (the Switch's textures on its default controls).
  • Kept as before: the pause menu's controller picture and its leader lines stay the game's on the keyboard face.

How

  • nx2/prompt_assets.py:
    • button_layers: the notes' and the letters' layers, cut out of face_layers unchanged, 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 keys nx2/prompt_keys.py names.
    • keyboard_layers: those, for every key, into prompts/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.
    • The pad faces' textures.bin are byte-identical to before (checked for Switch and Xbox).
  • host/prompts.c: with prompts/keyboard/textures.bin there, texture_face keeps the keyboard face's own textures and texture_bind gives each Switch button its first key (bind[HOS_SW_N + b]), which current_binds already 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's textures.bin as generate now does.

prompts/keyboard/textures.bin is 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.

The songbook: before A L R, after the keys bound, then Xbox live

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:

Case Result
Keyboard, the songbook (Song of Time) ✅ E Q R E Q R on the staff (was A L R A L R)
prompts: keyboard textures at the start ✅ 40 runs for this pad's controls
Keyboard → Xbox, the songbook open ✅ A LB RB A LB RB at once (now xbox textures: 2201 runs written, 40 put back)
Xbox → Keyboard, the songbook open ✅ E Q R again (now keyboard textures: 40 runs written, 2201 put back)
The ocarina's hint, the HUD ✅ unchanged: Z for the songbook, Q R mouse Space E for the notes

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_fonts and test_release_prompt_packages pass. tests/run_all.py on 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

… 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 Joey-Magnus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants