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

@@ -787,7 +787,17 @@ static void camera_overlay(void) {
// did not load (ROMFS_PROMPTS_*). The menu compares them with the settings in effect (ui/menu.cpp prompts_note).
// romfs-patches-pc keeps that name, but at a game resolution of another shape than 16:9 its files come from pc_dir,
// romfs-patches-pc-<w>x<h> (overlay_init).
#define PROMPTS_FOLDERS 5 // Xbox and PlayStation by position and by label, then PC
#define PROMPTS_PADS 3 // the pad styles: Xbox, PlayStation, Steam Deck
#define PROMPTS_FOLDERS (PROMPTS_PADS * 2 + 1) // each pad style by position and by label, then PC
// A style's name in the log and its NX2NAVI_PROMPTS value.
static const char *prompts_style(int pick) {
return pick == PROMPTS_PC ? "keyboard and mouse" : pick == PROMPTS_PLAYSTATION ? "PlayStation"
: pick == PROMPTS_STEAMDECK ? "Steam Deck" : "Xbox";
}
static const char *prompts_value(int pick) {
return pick == PROMPTS_PC ? "pc" : pick == PROMPTS_PLAYSTATION ? "playstation"
: pick == PROMPTS_STEAMDECK ? "steamdeck" : "xbox";
}
static struct { const char *name; int ready; } prompts_folders[PROMPTS_FOLDERS];
static const char *prompts_wanted, *prompts_loaded;
static int prompts_off;
@@ -830,7 +840,7 @@ static void overlay_init(void) {
// A game resolution that is not 16:9 takes romfs-patches-<w>x<h> instead when it is there: the same overlay with
// the UI laid out for that shape (make_romfs_patches.py --aspect), when the game version has the camera aspect patch
// the layout goes with (res_wants_wide_overlay).
// With prompts = xbox or playstation, that pad's prompts folder for the pad layout in its place
// With prompts = xbox, playstation or steamdeck, that pad's prompts folder for the pad layout in its place
// (input_prompts_folder): the game's button font and interface textures with that pad's buttons drawn in
// (tools/pad_prompts.py). The game reads the font and the archives once at boot, so
// the prompts stay until restart even though the layout itself changes live. Each folder replaces romfs-patches as
@@ -857,7 +867,7 @@ static void overlay_init(void) {
}
}
static const char *const layouts[2] = {"nintendo", "xbox"}; // each pad's two folders, then the PC one
static const int pads[2] = {PROMPTS_XBOX, PROMPTS_PLAYSTATION};
static const int pads[PROMPTS_PADS] = {PROMPTS_XBOX, PROMPTS_PLAYSTATION, PROMPTS_STEAMDECK};
for (int i = 0; i < PROMPTS_FOLDERS; i++) {
int pc = i == PROMPTS_FOLDERS - 1;
const char *name = pc ? input_prompts_folder(PROMPTS_PC, 0) : input_prompts_folder(pads[i / 2], layouts[i % 2]);
@@ -873,7 +883,7 @@ static void overlay_init(void) {
}
const char *layout = cfg_value("NX2NAVI_PAD_LAYOUT");
int pick = input_prompts_pick(cfg_get("NX2NAVI_PROMPTS"), layout), shaped = wide && pick == PROMPTS_PC;
const char *style = pick == PROMPTS_PC ? "keyboard and mouse" : pick == PROMPTS_PLAYSTATION ? "PlayStation" : "Xbox";
const char *style = prompts_style(pick);
prompts_wanted = input_prompts_folder(pick, layout);
prompts_off = !prompts_wanted ? ROMFS_PROMPTS_OK
: wide && !shaped ? ROMFS_PROMPTS_SHAPE
@@ -895,7 +905,7 @@ static void overlay_init(void) {
}
} else if (prompts_wanted) {
rt_log("RomFS overlay: prompts = %s, but %s; Switch prompts stay",
pick == PROMPTS_PC ? "pc" : pick == PROMPTS_PLAYSTATION ? "playstation" : "xbox",
prompts_value(pick),
prompts_off == ROMFS_PROMPTS_SHAPE ? (shaped ? "the game resolution has no romfs-patches-pc-<w>x<h> "
"(tools/make_romfs_patches.py --prompts pc --aspect)"
: "the game resolution takes its own UI layout")