mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 11:29:58 -04:00
Add Xbox and PlayStation button prompts, drawn from button art on the player's machine.
The Controls tab has a Button prompts row again, with Nintendo, Xbox and PlayStation. prompts = playstation is a new value next to xbox; nintendo, xbox and pc read as before, and pc stays out of the row as nothing makes its files for this game. The game reads its prompts at start, so the row says when a restart would change them. tools/pad_prompts.py writes the overlay folders romfs-patches-xbox, -xbox-label, -playstation and -playstation-label from the player's RomFS and a folder of button art that stays outside the repository. The button font's glyphs become outlines traced from the art, the action prompt's letters and the ocarina's note buttons are painted again in their own BC4 and ASTC formats, and the font's entry in the resource size table grows with it. The by-position folders show Switch A as B or circle, the by-label ones as A or cross, following the pad layout. The settings probe checks the new value and folder names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -297,16 +297,21 @@ int input_pad_layout_pick(const char *setting, int east_labelled_a) {
|
||||
|
||||
int input_prompts_pick(const char *prompts, const char *pad_layout) {
|
||||
if (prompts && *prompts)
|
||||
return !strcasecmp(prompts, "xbox") ? PROMPTS_XBOX : !strcasecmp(prompts, "pc") ? PROMPTS_PC : PROMPTS_NINTENDO;
|
||||
return !strcasecmp(prompts, "xbox") ? PROMPTS_XBOX
|
||||
: !strcasecmp(prompts, "playstation") ? PROMPTS_PLAYSTATION
|
||||
: !strcasecmp(prompts, "pc") ? PROMPTS_PC
|
||||
: PROMPTS_NINTENDO;
|
||||
return pad_layout && !strcasecmp(pad_layout, "xbox_prompts") ? PROMPTS_XBOX : PROMPTS_NINTENDO;
|
||||
}
|
||||
|
||||
const char *input_prompts_folder(int prompts, const char *pad_layout) {
|
||||
if (prompts == PROMPTS_PC) return "romfs-patches-pc";
|
||||
if (prompts != PROMPTS_XBOX) return NULL;
|
||||
if (prompts != PROMPTS_XBOX && prompts != PROMPTS_PLAYSTATION) return NULL;
|
||||
// The folders are read at start, before a pad is open: auto counts as Xbox, as for a pad without Nintendo labels.
|
||||
// A Nintendo-labelled pad under auto plays by label too (its A is on the button labelled A), so it matches as well.
|
||||
return input_pad_layout_pick(pad_layout, 0) == PAD_LAYOUT_NINTENDO ? "romfs-patches-xbox" : "romfs-patches-xbox-label";
|
||||
int by_position = input_pad_layout_pick(pad_layout, 0) == PAD_LAYOUT_NINTENDO;
|
||||
if (prompts == PROMPTS_PLAYSTATION) return by_position ? "romfs-patches-playstation" : "romfs-patches-playstation-label";
|
||||
return by_position ? "romfs-patches-xbox" : "romfs-patches-xbox-label";
|
||||
}
|
||||
|
||||
uint64_t input_map_pad_buttons(const uint8_t down[PAD_COUNT], int layout) {
|
||||
|
||||
Reference in New Issue
Block a user