Add Steam Deck button prompts beside the Xbox and PlayStation ones (prompts = steamdeck).

The Controls tab's Button prompts row and nx2navi.ini take steamdeck: the Deck's own labels in the game's
text, action prompt and ocarina notes, which are A B X Y where an Xbox pad has them, L1 R1 L2 R2 and L3 R3,
Menu and View. The style is drawn by tools/pad_prompts.py like the others, into romfs-patches-steamdeck
and romfs-patches-steamdeck-label, and every build with button art writes them.

Pull request #107 by loteran asked for PlayStation and Steam Deck prompts; it was closed, and the tree
took the PlayStation half in another form, drawn from button art instead of redrawn font glyphs. This is
the Steam Deck half in that form, written here: the art has no Deck style, so its entry in
tools/prompt_art.py names the Xbox pictures for the face buttons, Menu, View, the d-pad and the sticks
and the PlayStation pictures for the shoulders and stick clicks. It needs four pictures of the Xbox set
that no other style used (the white letters on a light button, for the ocarina's notes); a release made
with --prompt-art copies them with the rest.

The Windows files compile and tests/launcher_test.py passes, with the prompts step's test following the
number of folders (seven now); every picture the style names is in the art used for releases. The style
was not drawn here (that needs the game's font), and --probe-cfg, which has a new check, was not run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 06:53:30 -05:00
parent bc4ea7574f
commit 75b0dca907
21 changed files with 90 additions and 47 deletions

View File

@@ -20,7 +20,7 @@ Steps, each skipped when a run before finished it for the same inputs (state in
(`ocarina.exe --prepare-shaders`); variants met in play with another bind state are still translated
then, and the driver cache is per executable and is lost when the driver clears it
7. prompts only with button art in the kit (<kit>/prompt-art, tools/make_launcher.py and make_kit.py
--prompt-art): tools/pad_prompts.py draws the Xbox, PlayStation and keyboard and mouse button prompts
--prompt-art): tools/pad_prompts.py draws the Xbox, PlayStation, Steam Deck and keyboard and mouse button prompts
from it into <out>/romfs-patches-* (the Controls menu's Button prompts loads them), the keys as the
bind_ lines of <out>/nx2navi.ini give them. Its key names everything it reads (the RomFS, the art, the
tools, those lines), so it runs again only when one of them changed or a folder is gone, and running
@@ -1602,7 +1602,7 @@ def bind_lines(out):
def step_prompts(out):
"""The button prompts drawn from the kit's art into the game folder: tools/pad_prompts.py writes one overlay
folder per style and layout (prompt_art.OVERLAYS), which runtime/romfs.c loads in place of the game's button font
and prompt textures when the Controls menu's Button prompts is Xbox, PlayStation or Keyboard and mouse. Its lines
and prompt textures when the Controls menu's Button prompts is Xbox, PlayStation, Steam Deck or Keyboard and mouse. Its lines
go on to the log, each folder written is a progress event."""
total = len(prompt_art.OVERLAYS)
proc = subprocess.Popen(py_cmd(KIT / 'tools' / 'pad_prompts.py', '--art', prompt_art_dir(), '--game', out),

View File

@@ -16,7 +16,7 @@ it is zipped.
--prompt-art names folders that hold XGamepad, P5Gamepad and Keyboard_Mouse, or those three folders themselves: the
pictures tools/pad_prompts.py reads go into the kit's prompt-art folder (tools/prompt_art.py art_files), and
make_game.py draws the Xbox, PlayStation and keyboard and mouse prompts from them. Without it the kit builds the game
make_game.py draws the Xbox, PlayStation, Steam Deck and keyboard and mouse prompts from them. Without it the kit builds the game
with the game's own prompts only.
"""
import argparse

View File

@@ -27,7 +27,7 @@ The release folder (--out) holds:
licences and a notice),
lib/libnx2navirt.a (the runtime, prebuilt with the release's compiler),
prompt-art/ with --prompt-art (the button art make_game.py draws the Xbox,
PlayStation and keyboard and mouse prompts from, tools/prompt_art.py art_files),
PlayStation, Steam Deck and keyboard and mouse prompts from, tools/prompt_art.py art_files),
toolchain.lock.json (the MSYS2 packages of today, pinned), feed.json, VERSION, the
licence files
NX2navi-Setup-<version>.exe launcher/native/setup.c with the folder above appended as a zip: the one file

View File

@@ -1,7 +1,8 @@
"""Xbox, PlayStation and keyboard-and-mouse button prompts for Ocarina of Time (Switch 2), drawn from button art on the
player's machine.
"""Xbox, PlayStation, Steam Deck and keyboard-and-mouse button prompts for Ocarina of Time (Switch 2), drawn from button
art on the player's machine.
python tools/pad_prompts.py --art FOLDER --game FOLDER [--style xbox|playstation|pc] [--layout position|label]
python tools/pad_prompts.py --art FOLDER --game FOLDER [--style xbox|playstation|steamdeck|pc]
[--layout position|label]
[--binds nx2navi.ini]
--art is a folder of button art with the file names of STYLES (tools/prompt_art.py) and KEY_ART below: the Source
@@ -14,7 +15,9 @@ romfs.bin, as the setup writes them); --romfs names another, which may also be a
style and layout becomes the overlay folder <game>/romfs-patches-<style> (layout position) or
<game>/romfs-patches-<style>-label (layout label), and the keyboard and mouse <game>/romfs-patches-pc, each with a
manifest.tsv: runtime/romfs.c overlay_init loads it in place of the game's files when nx2navi.ini has prompts = xbox,
playstation or pc (runtime/input_map.c input_prompts_folder). Without --style or --layout, every style or layout.
playstation, steamdeck or pc (runtime/input_map.c input_prompts_folder). Without --style or --layout, every style or
layout. The Steam Deck style has no art of its own: its buttons are named as an Xbox pad's face buttons and a
PlayStation pad's shoulders and stick clicks, so it is drawn from those two pads' pictures (prompt_art.py STYLES).
--out writes a single style and layout elsewhere.
The two pad layouts follow pad_layout (runtime/input_map.c). position, for pad_layout = nintendo: a pad is played by

View File

@@ -63,6 +63,19 @@ STYLES = {
'west': f'{PL}Square_Color_Light.png', 'north': f'{PL}Triangle_Color_Light.png',
'L': f'{PL}L1_Light.png', 'R': f'{PL}R1_Light.png'},
},
# The Steam Deck's own labels, from the two pads' pictures (the packs have no Deck style): A B X Y where an Xbox pad
# has them, in white as the Deck prints them; L1 R1 L2 R2 and L3 R3 as a PlayStation pad names them; Menu (three
# bars) and View.
'steamdeck': {
'glyph': {'south': f'{X}A_White.png', 'east': f'{X}B_White.png', 'west': f'{X}X_White.png',
'north': f'{X}Y_White.png', 'L': f'{P}L1.png', 'R': f'{P}R1.png', 'ZL': f'{P}L2.png',
'ZR': f'{P}R2.png', 'PLUS': f'{X}X.png', 'MINUS': f'{X}Share.png',
**_dpad(X, 'Dpad', 'Up'), **_sticks(X, ('L', 'R'), ('Left_Stick_Click.png', 'Right_Stick_Click.png'),
'R_2D.png'),
'LSTICK_PRESS': f'{P}L3.png', 'RSTICK_PRESS': f'{P}R3.png'},
'note': {'south': f'{XL}A_White_Light.png', 'east': f'{XL}B_White_Light.png', 'west': f'{XL}X_White_Light.png',
'north': f'{XL}Y_White_Light.png', 'L': f'{PL}L1_Light.png', 'R': f'{PL}R1_Light.png'},
},
}
# The keyboard and mouse: a key in each shade (Dark: a dark key with a white label, the button font and the action