Pick the gamepad button layout by the pad's labels, with a Button layout row on the Controls tab

The gamepad map was by position only, so on an Xbox pad the button labelled A pressed Switch B. pad_layout = auto
(default) keeps the Nintendo layout for a pad whose east button SDL reports labelled A and uses the Xbox layout (south
A, east B, west X, north Y; cross A on a PlayStation pad) for the others; nintendo and xbox force one. It applies at
once; bind_ lines name physical buttons and apply on top of either layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-10-29 17:20:03 +03:00
1 parent f654da3d8b
commit ba0f33e044
11 files changed
+149 -38

No files matched your search

+4 -3
View File
@@ -39,7 +39,7 @@ static const char *const known[] = {
"GPU_INDEX", "GPU_NAME", "HIGHFPS_FIX", "INPUT", "INPUT_RECORD", "INPUT_SCRIPT", "LANG", "LIB_PREBUILD",
"LIB_PREBUILD_KEEP", "LIB_PREBUILD_THREADS", "LOCALE", "LOD_GUARD", "MEMORY", "MENU_LANG", "MENU_TEST",
"MENU_TEST_DIR", "MENU_TEST_SET", "MINIMAL_LAYOUT", "MIRROR_GAP", "MOTION", "MOUSE_SENS", "MOVIE_HOST", "MOVIE_PACE",
"ONE_PER_CORE", "OPERATION_MODE", "OUTPUT_RES", "PATCH_OUTPUT", "PATCH_SCENE", "PERF_OVERLAY", "PERF_SLOW_MS", "PIPELINE_CACHE", "PIPE_MEMO", "PIPE_PREBUILD", "PIPE_SKIP", "PIPE_SYNC", "PIPE_WAIT",
"ONE_PER_CORE", "OPERATION_MODE", "OUTPUT_RES", "PAD_LAYOUT", "PATCH_OUTPUT", "PATCH_SCENE", "PERF_OVERLAY", "PERF_SLOW_MS", "PIPELINE_CACHE", "PIPE_MEMO", "PIPE_PREBUILD", "PIPE_SKIP", "PIPE_SYNC", "PIPE_WAIT",
"PREWARM_XLATE", "PROBE_MOVIE", "PROBE_MOVIE_SHOT", "PROFILE", "PROFILE_CHAINS", "PROFILE_DIR", "PROFILE_FRAMES",
"PROFILE_MAIN", "PROFILE_RENDER", "PUSH_SKIP", "PUSH_STAGE", "RDOC", "RDOC_DIR", "RDOC_DLL", "REALTIME", "REEXEC",
"RENDER_SCALE", "REPLAY_ASYNC",
@@ -61,7 +61,7 @@ static const struct { const char *key, *section; } sections[] = {
{"MENU_LANG", "language"}, {"LANG", "language"}, {"OPERATION_MODE", "language"},
{"VOLUME", "audio"},
{"MOTION", "input"}, {"RUMBLE_STRENGTH", "input"}, {"RUMBLE_CURVE", "input"}, {"RUMBLE_TRIGGERS", "input"},
{"MOUSE_SENS", "input"}, {"INPUT_RECORD", "input"},
{"PAD_LAYOUT", "input"}, {"MOUSE_SENS", "input"}, {"INPUT_RECORD", "input"},
{"ASYNC_PREEMPT", "performance"}, {"REPLAY_ASYNC", "performance"}, {"FREE_CORES", "performance"},
{"TIMER_1MS", "performance"}, {"PIPE_WAIT", "performance"}, {"PIPE_SKIP", "performance"},
{"LIB_PREBUILD", "performance"}, {"LIB_PREBUILD_THREADS", "performance"}, {"PIPE_PREBUILD", "performance"},
@@ -94,7 +94,8 @@ static const CfgMeta metas[] = {
// Sound, Controls, Menu
{"VOLUME", "100", "0..100", LIVE},
{"MOTION", "1", "0|1", LIVE}, {"RUMBLE_STRENGTH", "130", "0..300", LIVE}, {"RUMBLE_CURVE", "0.6", "0.2..1.5", LIVE},
{"RUMBLE_TRIGGERS", "0", "0|1", LIVE}, {"MOUSE_SENS", "1", "0..10", LIVE},
{"RUMBLE_TRIGGERS", "0", "0|1", LIVE}, {"PAD_LAYOUT", "auto", "auto|nintendo|xbox", LIVE},
{"MOUSE_SENS", "1", "0..10", LIVE},
{"MENU_LANG", "", "en|ru", LIVE},
// Advanced: scheduling
{"ASYNC_PREEMPT", "1", "0|1|2", RESTART}, {"REPLAY_ASYNC", "0", "0|1", RESTART},
+19
View File
@@ -261,6 +261,25 @@ int probe_cfg(void) {
CHECK((int64_t)st[0] * st[0] + (int64_t)st[1] * st[1] <= 32768ll * 32768, "mouse: clamped to the unit circle");
input_mouse_stick(30, 0, 1.0 / 60, 0, st);
CHECK(st[0] == 0 && st[1] == 0, "mouse: sensitivity 0 is off");
// Gamepad layouts (input_map.c)
CHECK(input_pad_layout_pick("auto", 1) == PAD_LAYOUT_NINTENDO && input_pad_layout_pick(NULL, 0) == PAD_LAYOUT_XBOX,
"pad layout: automatic is Nintendo for an east button labelled A, Xbox otherwise");
CHECK(input_pad_layout_pick("Xbox", 1) == PAD_LAYOUT_XBOX && input_pad_layout_pick("nintendo", 0) == PAD_LAYOUT_NINTENDO,
"pad layout: a set layout wins over the labels");
uint8_t pd[PAD_COUNT] = {0};
pd[PAD_SOUTH] = pd[PAD_NORTH] = 1;
CHECK(input_map_pad_buttons(pd, PAD_LAYOUT_NINTENDO) == (1ull << B_B | 1ull << B_X) &&
input_map_pad_buttons(pd, PAD_LAYOUT_XBOX) == (1ull << B_A | 1ull << B_Y),
"pad layout: south and north are B and X by position, A and Y on Xbox");
pd[PAD_SOUTH] = pd[PAD_NORTH] = 0;
pd[PAD_START] = pd[PAD_ZR] = 1;
CHECK(input_map_pad_buttons(pd, PAD_LAYOUT_XBOX) == (1ull << B_PLUS | 1ull << B_ZR), "pad layout: Xbox keeps the other buttons");
CHECK(input_map_bind("A", "pad:west") && input_map_pad_buttons((uint8_t[PAD_COUNT]){[PAD_WEST] = 1}, PAD_LAYOUT_XBOX) ==
(1ull << B_A | 1ull << B_X),
"pad layout: a bind line adds its physical button in every layout");
CHECK(input_map_pad_buttons((uint8_t[PAD_COUNT]){[PAD_SOUTH] = 1}, PAD_LAYOUT_XBOX) == 0,
"pad layout: a bind line replaces the layout's own button");
input_map_reset();
// defaults live in the CfgMeta table: cfg_value and the typed accessors fall back to it
cfg_load("cfg-probe-missing.ini");
_putenv_s("TOTK_FPS60", "");
+2
View File
@@ -21,6 +21,8 @@ void input_menu(int open);
// of the combo, sticks are lx, ly, rx, ry. Returns 1 in the poll where the combo goes down (toggle the menu once).
int input_menu_gate(int *held, int menu_open, uint64_t *buttons, int32_t sticks[4]);
int input_pad_read(uint64_t *buttons, int32_t *lx, int32_t *ly);
// The gamepad layout in effect (PAD_LAYOUT_*, input_map.h; TOTK_PAD_LAYOUT, live); -1 without a gamepad. Any thread.
int input_pad_layout(void);
// Mouse camera and cursor (input_win.c, Win32 window thread). The window procedure calls input_window_msg first for raw
// mouse input, cursor hiding and confinement; it returns 1 with *res set when the message is handled. input_cursor_suspend(1)
+32 -19
View File
@@ -22,18 +22,19 @@
{KEY_1, B_LEFT}, {KEY_2, B_UP}, {KEY_3, B_RIGHT}, {KEY_4, B_DOWN}, \
{KEY_TAB, B_PLUS}, {KEY_M, B_MINUS}
// By position: south is Switch B, east A, west Y, north X (Nintendo layout); the triggers are ZL and ZR.
#define DEFAULT_PADS \
{PAD_SOUTH, B_B}, {PAD_EAST, B_A}, {PAD_WEST, B_Y}, {PAD_NORTH, B_X}, {PAD_LSTICK, B_STICK_L}, {PAD_RSTICK, B_STICK_R}, \
{PAD_L, B_L}, {PAD_R, B_R}, {PAD_START, B_PLUS}, {PAD_BACK, B_MINUS}, {PAD_DPAD_LEFT, B_LEFT}, {PAD_DPAD_UP, B_UP}, \
{PAD_DPAD_RIGHT, B_RIGHT}, {PAD_DPAD_DOWN, B_DOWN}, {PAD_ZL, B_ZL}, {PAD_ZR, B_ZR}
// By position: south is Switch B, east A, west Y, north X (Nintendo layout); the Xbox layout swaps A with B and X with Y
// (south A, as the Xbox labels; cross A on a PlayStation pad). The triggers are ZL and ZR.
#define DEFAULT_PADS(south, east, west, north) {PAD_SOUTH, south}, {PAD_EAST, east}, {PAD_WEST, west}, {PAD_NORTH, north}, {PAD_LSTICK, B_STICK_L}, {PAD_RSTICK, B_STICK_R}, {PAD_L, B_L}, {PAD_R, B_R}, {PAD_START, B_PLUS}, {PAD_BACK, B_MINUS}, {PAD_DPAD_LEFT, B_LEFT}, {PAD_DPAD_UP, B_UP}, {PAD_DPAD_RIGHT, B_RIGHT}, {PAD_DPAD_DOWN, B_DOWN}, {PAD_ZL, B_ZL}, {PAD_ZR, B_ZR}
#define NINTENDO_PADS DEFAULT_PADS(B_B, B_A, B_Y, B_X)
#define XBOX_PADS DEFAULT_PADS(B_A, B_B, B_X, B_Y)
enum { DEFAULT_PAD_COUNT = 16 };
static const Binding default_keys[] = {DEFAULT_KEYS};
static const PadBinding default_pads[] = {DEFAULT_PADS};
static const PadBinding default_pads[PAD_LAYOUT_COUNT][DEFAULT_PAD_COUNT] = {{NINTENDO_PADS}, {XBOX_PADS}};
Binding input_bindings[INPUT_BINDING_MAX] = {DEFAULT_KEYS};
int input_binding_count = (int)(sizeof default_keys / sizeof *default_keys);
PadBinding input_pad_bindings[INPUT_PAD_BINDING_MAX] = {DEFAULT_PADS};
int input_pad_binding_count = (int)(sizeof default_pads / sizeof *default_pads);
PadBinding input_pad_bindings[PAD_LAYOUT_COUNT][INPUT_PAD_BINDING_MAX] = {{NINTENDO_PADS}, {XBOX_PADS}};
int input_pad_binding_count[PAD_LAYOUT_COUNT] = {DEFAULT_PAD_COUNT, DEFAULT_PAD_COUNT};
static const char *const button_names[16] = {"A", "B", "X", "Y", "LCLICK", "RCLICK", "L", "R", "ZL", "ZR", "PLUS", "MINUS",
"LEFT", "UP", "RIGHT", "DOWN"}; // indexed by action
@@ -48,8 +49,10 @@ static const char *const key_names[KEY_COUNT] = { // letters and digits are ha
void input_map_reset(void) {
memcpy(input_bindings, default_keys, sizeof default_keys);
input_binding_count = (int)(sizeof default_keys / sizeof *default_keys);
memcpy(input_pad_bindings, default_pads, sizeof default_pads);
input_pad_binding_count = (int)(sizeof default_pads / sizeof *default_pads);
for (int l = 0; l < PAD_LAYOUT_COUNT; l++) {
memcpy(input_pad_bindings[l], default_pads[l], sizeof default_pads[l]);
input_pad_binding_count[l] = DEFAULT_PAD_COUNT;
}
}
static int key_id(const char *name) {
@@ -105,12 +108,15 @@ int input_map_bind(const char *button, const char *list) {
if (input_bindings[i].action != action) input_bindings[w++] = input_bindings[i];
input_binding_count = w;
for (int i = 0; i < nk && input_binding_count < INPUT_BINDING_MAX; i++) input_bindings[input_binding_count++] = keys[i];
w = 0;
for (int i = 0; i < input_pad_binding_count; i++)
if (input_pad_bindings[i].action != action) input_pad_bindings[w++] = input_pad_bindings[i];
input_pad_binding_count = w;
for (int i = 0; i < np && input_pad_binding_count < INPUT_PAD_BINDING_MAX; i++)
input_pad_bindings[input_pad_binding_count++] = pads[i];
for (int l = 0; l < PAD_LAYOUT_COUNT; l++) { // a bind line names physical buttons: the same in every layout
PadBinding *t = input_pad_bindings[l];
int *n = &input_pad_binding_count[l];
w = 0;
for (int i = 0; i < *n; i++)
if (t[i].action != action) t[w++] = t[i];
*n = w;
for (int i = 0; i < np && *n < INPUT_PAD_BINDING_MAX; i++) t[(*n)++] = pads[i];
}
return 1;
}
@@ -124,10 +130,17 @@ void input_map_configure(void) {
}
}
uint64_t input_map_pad_buttons(const uint8_t down[PAD_COUNT]) {
int input_pad_layout_pick(const char *setting, int east_labelled_a) {
if (setting && !_stricmp(setting, "nintendo")) return PAD_LAYOUT_NINTENDO;
if (setting && !_stricmp(setting, "xbox")) return PAD_LAYOUT_XBOX;
return east_labelled_a ? PAD_LAYOUT_NINTENDO : PAD_LAYOUT_XBOX;
}
uint64_t input_map_pad_buttons(const uint8_t down[PAD_COUNT], int layout) {
const PadBinding *t = input_pad_bindings[layout];
uint64_t b = 0;
for (int i = 0; i < input_pad_binding_count; i++)
if (down[input_pad_bindings[i].pad]) b |= 1ull << input_pad_bindings[i].action;
for (int i = 0; i < input_pad_binding_count[layout]; i++)
if (down[t[i].pad]) b |= 1ull << t[i].action;
return b;
}
+15 -6
View File
@@ -33,23 +33,32 @@ enum {
enum { INPUT_BINDING_MAX = 96, INPUT_PAD_BINDING_MAX = 48 };
// The tables a remapping page edits. Defaults are the layout in docs/controls.md; input_map_reset restores them.
// Gamepad layouts (TOTK_PAD_LAYOUT): which face button is Switch A. Nintendo: by position, east A, south B, west Y,
// north X. Xbox: south A, east B, west X, north Y, as an Xbox pad labels them (cross A, circle B on a PlayStation pad).
enum { PAD_LAYOUT_NINTENDO, PAD_LAYOUT_XBOX, PAD_LAYOUT_COUNT };
// The tables a remapping page edits, one gamepad table per layout. Defaults are the layout in docs/controls.md;
// input_map_reset restores them.
typedef struct { uint8_t key; uint8_t action; } Binding;
typedef struct { uint8_t pad; uint8_t action; } PadBinding;
extern Binding input_bindings[INPUT_BINDING_MAX];
extern int input_binding_count;
extern PadBinding input_pad_bindings[INPUT_PAD_BINDING_MAX];
extern int input_pad_binding_count;
extern PadBinding input_pad_bindings[PAD_LAYOUT_COUNT][INPUT_PAD_BINDING_MAX];
extern int input_pad_binding_count[PAD_LAYOUT_COUNT];
void input_map_reset(void);
// Replaces every binding of the Switch button `button` (script name: A B X Y LCLICK RCLICK L R ZL ZR PLUS MINUS LEFT UP
// RIGHT DOWN, any case) with `list`: comma separated "pad:<name>" and "key:<name>" entries, or "none" for no input.
// Invalid entries are logged and skipped; when none is valid the button keeps its bindings. 1 when applied.
// Pad names are physical buttons, so the entries go into the gamepad table of every layout. Invalid entries are logged
// and skipped; when none is valid the button keeps its bindings. 1 when applied.
int input_map_bind(const char *button, const char *list);
// Applies the TOTK_BIND_<button> settings (cfg_get) over the defaults. Once, at start.
void input_map_configure(void);
// down[pad] != 0 for the gamepad inputs held. Returns the Switch button bits (0..15) the pad table presses.
uint64_t input_map_pad_buttons(const uint8_t down[PAD_COUNT]);
// The layout for a TOTK_PAD_LAYOUT value: "nintendo" or "xbox" (any case); anything else ("auto", NULL) picks Nintendo
// when the pad's east button is labelled A (a Switch Pro Controller, a GuliKit) and Xbox otherwise.
int input_pad_layout_pick(const char *setting, int east_labelled_a);
// down[pad] != 0 for the gamepad inputs held. Returns the Switch button bits (0..15) the layout's pad table presses.
uint64_t input_map_pad_buttons(const uint8_t down[PAD_COUNT], int layout);
// down[key] != 0 for the keys held. Returns the Switch button bits (0..15) the table presses.
uint64_t input_map_buttons(const uint8_t down[KEY_COUNT]);
+34 -6
View File
@@ -26,6 +26,10 @@ static int state; // 0 not started, 1 running, -1 disabled or
static SDL_Gamepad *pad;
static uint64_t next_scan;
static int pad_rumble; // the open gamepad has rumble motors
static int pad_east_a; // ... and labels its east face button A (Nintendo layout under TOTK_PAD_LAYOUT=auto)
static int pad_layout = -1; // PAD_LAYOUT_* in effect for the open gamepad, -1 to pick again; live (cfg_version)
static unsigned pad_layout_seen;
static volatile LONG pad_layout_shown = -1; // pad_layout for the menu (any thread), -1 without a gamepad
static SDL_JoystickID sensor_pad; // the gamepad whose sensors the motion thread set up, 0 none
static int sensor_ok; // ... and it has both sensors, enabled
static int motion_thread; // 0 not started, 1 running, -1 off (TOTK_MOTION=0, no SDL)
@@ -384,16 +388,36 @@ static int32_t axis(int16_t v) {
// Open the first gamepad when none is open or the open one went away; logs once per change.
static void scan_pads(void) {
if (pad && SDL_GamepadConnected(pad)) return;
if (pad) { SDL_CloseGamepad(pad); pad = NULL; sensor_pad = 0; sensor_ok = 0; rt_log("input: gamepad disconnected"); }
if (pad) {
SDL_CloseGamepad(pad); pad = NULL; sensor_pad = 0; sensor_ok = 0;
InterlockedExchange(&pad_layout_shown, -1);
rt_log("input: gamepad disconnected");
}
int n = 0;
SDL_JoystickID *ids = SDL_GetGamepads(&n);
for (int i = 0; ids && i < n && !pad; i++) pad = SDL_OpenGamepad(ids[i]);
SDL_free(ids);
if (!pad) return;
pad_rumble = SDL_GetBooleanProperty(SDL_GetGamepadProperties(pad), SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN, false);
pad_east_a = SDL_GetGamepadButtonLabel(pad, SDL_GAMEPAD_BUTTON_EAST) == SDL_GAMEPAD_BUTTON_LABEL_A;
pad_layout = -1;
int motion = SDL_GamepadHasSensor(pad, SDL_SENSOR_GYRO) && SDL_GamepadHasSensor(pad, SDL_SENSOR_ACCEL);
rt_log("input: gamepad \"%s\" (%s, %s)", SDL_GetGamepadName(pad), pad_rumble ? "rumble" : "no rumble",
motion ? "gyro and accelerometer" : "no motion sensors");
rt_log("input: gamepad \"%s\" (%s, %s, east button %s)", SDL_GetGamepadName(pad), pad_rumble ? "rumble" : "no rumble",
motion ? "gyro and accelerometer" : "no motion sensors", pad_east_a ? "labelled A" : "not labelled A");
}
// Under lock: the layout of the open gamepad, picked again when a setting or the gamepad changed; logs each change.
static int pad_layout_get(void) {
unsigned ver = cfg_version();
if (pad_layout >= 0 && ver == pad_layout_seen) return pad_layout;
pad_layout_seen = ver;
int was = pad_layout;
const char *set = cfg_value("TOTK_PAD_LAYOUT");
pad_layout = input_pad_layout_pick(set, pad_east_a);
if (pad_layout != was)
rt_log("input: gamepad layout %s (pad_layout = %s)", pad_layout == PAD_LAYOUT_XBOX ? "xbox" : "nintendo", set);
InterlockedExchange(&pad_layout_shown, pad_layout);
return pad_layout;
}
static void start(void) {
@@ -421,8 +445,8 @@ static void pick(int32_t *x, int32_t *y, int32_t kx, int32_t ky) {
if (b > a) { *x = kx; *y = ky; }
}
// Under lock, state 1: the open gamepad's buttons (Switch bits after the TOTK_BIND_* layout) and sticks; 0 without a
// connected gamepad.
// Under lock, state 1: the open gamepad's buttons (Switch bits after TOTK_PAD_LAYOUT and the TOTK_BIND_* lines) and
// sticks; 0 without a connected gamepad.
static int pad_read(uint64_t *b, int32_t sl[2], int32_t sr[2]) {
if ((!pad || !SDL_GamepadConnected(pad)) && GetTickCount64() >= next_scan) { next_scan = GetTickCount64() + RESCAN_MS; scan_pads(); }
SDL_UpdateGamepads();
@@ -431,7 +455,7 @@ static int pad_read(uint64_t *b, int32_t sl[2], int32_t sr[2]) {
for (int p = PAD_SOUTH; p < PAD_ZL; p++) pd[p] = SDL_GetGamepadButton(pad, pad_sdl[p]);
pd[PAD_ZL] = SDL_GetGamepadAxis(pad, SDL_GAMEPAD_AXIS_LEFT_TRIGGER) > TRIGGER_ON;
pd[PAD_ZR] = SDL_GetGamepadAxis(pad, SDL_GAMEPAD_AXIS_RIGHT_TRIGGER) > TRIGGER_ON;
*b |= input_map_pad_buttons(pd);
*b |= input_map_pad_buttons(pd, pad_layout_get());
sl[0] = axis(SDL_GetGamepadAxis(pad, SDL_GAMEPAD_AXIS_LEFTX));
sl[1] = -axis(SDL_GetGamepadAxis(pad, SDL_GAMEPAD_AXIS_LEFTY));
sr[0] = axis(SDL_GetGamepadAxis(pad, SDL_GAMEPAD_AXIS_RIGHTX));
@@ -539,6 +563,10 @@ uint16_t rumble_motor(float a, float curve, float strength) {
return v >= 65535.0f ? 65535 : (uint16_t)v;
}
int input_pad_layout(void) {
return (int)InterlockedCompareExchange(&pad_layout_shown, 0, 0);
}
int input_rumble_triggers_enabled(void) {
return cfg_bool("TOTK_RUMBLE_TRIGGERS");
}
+12
View File
@@ -548,8 +548,20 @@ static void tab_sound(float scale) {
opt_end();
}
// "in use: Xbox" under the layout when it is Automatic and a gamepad is connected; NULL otherwise.
static const char *pad_layout_note(void) {
int got = input_pad_layout();
if (got < 0 || strcmp(cfg_value("TOTK_PAD_LAYOUT"), "auto")) return nullptr;
static char note[96];
snprintf(note, sizeof note, menu_text(UI_MENU_PAD_LAYOUT_IN_USE),
menu_text(got == PAD_LAYOUT_XBOX ? UI_MENU_PAD_LAYOUT_XBOX : UI_MENU_PAD_LAYOUT_NINTENDO));
return note;
}
static void tab_controls(float scale) {
opt_begin("##controls", scale);
static const UiTextId layout[] = {UI_MENU_PAD_LAYOUT_AUTO, UI_MENU_PAD_LAYOUT_NINTENDO, UI_MENU_PAD_LAYOUT_XBOX};
opt_choice("TOTK_PAD_LAYOUT", UI_MENU_PAD_LAYOUT, layout, 3, UI_MENU_PAD_LAYOUT_DESC, pad_layout_note());
opt_toggle("TOTK_MOTION", UI_MENU_MOTION, UI_MENU_MOTION_DESC);
opt_slider("TOTK_RUMBLE_STRENGTH", UI_MENU_RUMBLE_STRENGTH, 0, 300, UI_MENU_RUMBLE_STRENGTH_DESC, 10, "%.0f %%");
opt_slider("TOTK_RUMBLE_CURVE", UI_MENU_RUMBLE_CURVE, 0.2f, 1.5f, UI_MENU_RUMBLE_CURVE_DESC, 0.05f, "%.2f");
+12
View File
@@ -91,6 +91,12 @@ static const char *const text_en[UI_TEXT_COUNT] = {
[UI_MENU_RUMBLE_CURVE_DESC] = "Lower values make weak vibration stronger.",
[UI_MENU_RUMBLE_TRIGGERS] = "Trigger vibration (Xbox)",
[UI_MENU_RUMBLE_TRIGGERS_DESC] = "Vibrates the triggers of an Xbox controller too.",
[UI_MENU_PAD_LAYOUT] = "Button layout",
[UI_MENU_PAD_LAYOUT_DESC] = "Which button is A. Nintendo: the right one, as on a Switch. Xbox: the bottom one, as "
"labelled on an Xbox controller (cross on a PlayStation controller). Automatic picks "
"Nintendo for controllers with Nintendo labels and Xbox for the others.",
[UI_MENU_PAD_LAYOUT_AUTO] = "Automatic", [UI_MENU_PAD_LAYOUT_NINTENDO] = "Nintendo (A right)",
[UI_MENU_PAD_LAYOUT_XBOX] = "Xbox (A bottom)", [UI_MENU_PAD_LAYOUT_IN_USE] = "in use: %s",
[UI_MENU_MOUSE_SENS] = "Mouse camera sensitivity",
[UI_MENU_MOUSE_SENS_DESC] = "How fast the mouse turns the camera.",
@@ -258,6 +264,12 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
[UI_MENU_RUMBLE_CURVE_DESC] = "Чем ниже значение, тем сильнее слабая вибрация.",
[UI_MENU_RUMBLE_TRIGGERS] = "Вибрация триггеров (Xbox)",
[UI_MENU_RUMBLE_TRIGGERS_DESC] = "Вибрация и в триггерах контроллера Xbox.",
[UI_MENU_PAD_LAYOUT] = "Раскладка кнопок",
[UI_MENU_PAD_LAYOUT_DESC] = "Какая кнопка работает как A. Nintendo: правая, как на Switch. Xbox: нижняя, как "
"подписано на контроллере Xbox (крест на контроллере PlayStation). Автоматически: "
"Nintendo для контроллеров с подписями Nintendo, Xbox для остальных.",
[UI_MENU_PAD_LAYOUT_AUTO] = "Автоматически", [UI_MENU_PAD_LAYOUT_NINTENDO] = "Nintendo (A справа)",
[UI_MENU_PAD_LAYOUT_XBOX] = "Xbox (A снизу)", [UI_MENU_PAD_LAYOUT_IN_USE] = "сейчас: %s",
[UI_MENU_MOUSE_SENS] = "Чувствительность мыши",
[UI_MENU_MOUSE_SENS_DESC] = "Как быстро мышь поворачивает камеру.",
+2
View File
@@ -54,6 +54,8 @@ typedef enum {
UI_MENU_RUMBLE_STRENGTH, UI_MENU_RUMBLE_STRENGTH_DESC,
UI_MENU_RUMBLE_CURVE, UI_MENU_RUMBLE_CURVE_DESC,
UI_MENU_RUMBLE_TRIGGERS, UI_MENU_RUMBLE_TRIGGERS_DESC,
UI_MENU_PAD_LAYOUT, UI_MENU_PAD_LAYOUT_DESC, UI_MENU_PAD_LAYOUT_AUTO, UI_MENU_PAD_LAYOUT_NINTENDO,
UI_MENU_PAD_LAYOUT_XBOX, UI_MENU_PAD_LAYOUT_IN_USE,
UI_MENU_MOUSE_SENS, UI_MENU_MOUSE_SENS_DESC,
// Menu tab