diff --git a/runtime/cfg.c b/runtime/cfg.c index 2ee51e2d..485eda3e 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -189,6 +189,7 @@ static const CfgMeta metas[] = { {"QUICKSAVE", "0", "0|1", LIVE}, // quicksave.c: one key saves (an autosave), another loads it {"QUICKSAVE_KEY", "f6", NULL, LIVE}, {"QUICKLOAD_KEY", "f7", NULL, LIVE}, // Half-Life's keys; a key name or none {"WALK_KEY", "none", NULL, LIVE}, {"WALK_SCALE", "0.51", "0.2..0.9", LIVE}, + {"FREECAM_PAD", "zl+zr+lstick", NULL, LIVE}, // Gameplay Tweaks {"GAMEPLAY_TWEAKS_ENABLED", "0", "0|1", LIVE}, {"GAMEPLAY_ULTRAHAND_ROTATE", "1", "0|1", LIVE}, {"GAMEPLAY_ULTRAHAND_C_AXIS", "1", "0|1", LIVE}, diff --git a/runtime/ui/menu.cpp b/runtime/ui/menu.cpp index 4bff6396..dcbdca7c 100644 --- a/runtime/ui/menu.cpp +++ b/runtime/ui/menu.cpp @@ -944,6 +944,25 @@ static void row_quicksave_keys(void) { key_taken("TOTK_QUICKLOAD_KEY", note[1], sizeof note[1])); } +// The free camera combo (freecam.c): the trigger and shoulder pairs with a stick click, named as the open pad labels +// its buttons, or none. totk.ini takes any combo of button positions, shown as written. Off on other game versions. +static void row_freecam_pad(void) { + static const char *const combos[] = {"zl+zr+lstick", "zl+zr+rstick", "l+r+lstick", "l+r+rstick", "none"}; + static const int pads[][3] = {{PAD_ZL, PAD_ZR, PAD_LSTICK}, {PAD_ZL, PAD_ZR, PAD_RSTICK}, + {PAD_L, PAD_R, PAD_LSTICK}, {PAD_L, PAD_R, PAD_RSTICK}}; + enum { N = sizeof combos / sizeof *combos }; + static char shown[N - 1][128]; + const char *names[N]; + for (int i = 0; i < N - 1; i++) { + snprintf(shown[i], sizeof shown[i], "%s + %s + %s", binds_pad_label(pads[i][0]), binds_pad_label(pads[i][1]), + binds_pad_label(pads[i][2])); + names[i] = shown[i]; + } + names[N - 1] = menu_text(UI_MENU_OFF); + if (!freecam_available()) opt_disable_next(UI_MENU_FREECAM_PAD_V143); + opt_choice_list("TOTK_FREECAM_PAD", UI_MENU_FREECAM_PAD, combos, names, N, UI_MENU_FREECAM_PAD_DESC); +} + // The note under the prompts. The settings name a folder of prompts (input_prompts_folder: the prompts and the pad // layout, as a layout that puts A on the right button needs the face buttons named the other way round), but the game // reads its fonts and UI archive once at start (romfs.c overlay_init). While the folder in use differs: when the @@ -1084,6 +1103,7 @@ static void tab_controls(float scale) { row_quicksave_keys(); row_walk_key(); opt_slider("TOTK_WALK_SCALE", UI_MENU_WALK_SCALE, 0.2f, 0.9f, UI_MENU_WALK_SCALE_DESC, 0.01f, "%.2f"); + row_freecam_pad(); rows_gameplay_tweaks(); // Analog sticks: one dead zone row per stick, falling back to TOTK_STICK_DEADZONE (both sticks) while unset. With // a gamepad connected each row shows its stick's deflection now, before the dead zone: a drifting stick's resting diff --git a/runtime/ui_text.c b/runtime/ui_text.c index ff43bf01..abd56a73 100644 --- a/runtime/ui_text.c +++ b/runtime/ui_text.c @@ -358,6 +358,11 @@ static const char *const text_en[UI_TEXT_COUNT] = { [UI_MENU_WALK_SCALE] = "Walk scale", [UI_MENU_WALK_SCALE_DESC] = "The tilt the keyboard's sticks get while the walk key is held. Half is a walk, the " "full tilt a run.", + [UI_MENU_FREECAM_PAD] = "Free camera combo", + [UI_MENU_FREECAM_PAD_DESC] = "Gamepad buttons pressed together that detach the view from Link and bring it back. " + "While it is on the game gets no input: the left stick flies along the view and sideways, the triggers up and " + "down, the right stick turns, and each press of L or R halves or doubles the speed. Game version 1.4.3.", + [UI_MENU_FREECAM_PAD_V143] = "Game version 1.4.3 only", [UI_MENU_GROUP_GAMEPLAY_TWEAKS] = "Gameplay tweaks", [UI_MENU_GAMEPLAY_TWEAKS_ENABLED] = "Gameplay tweaks", [UI_MENU_GAMEPLAY_TWEAKS_ENABLED_DESC] = "Mouse wheel controls for Ultrahand rotation and distance, item and weapon switching, and smooth map zoom.", @@ -969,6 +974,11 @@ static const char *const text_ru[UI_TEXT_COUNT] = { [UI_MENU_WALK_SCALE] = "Сила шага", [UI_MENU_WALK_SCALE_DESC] = "Отклонение стиков клавиатуры при удержании клавиши шага. Половина — шаг, полное " "отклонение — бег.", + [UI_MENU_FREECAM_PAD] = "Сочетание свободной камеры", + [UI_MENU_FREECAM_PAD_DESC] = "Кнопки геймпада, нажатые вместе, отделяют камеру от Линка и возвращают её. Пока она " + "включена, игра не получает ввод: левый стик ведёт камеру вдоль взгляда и вбок, курки — вверх и вниз, правый " + "стик поворачивает, а каждое нажатие L или R уменьшает или увеличивает скорость вдвое. Версия игры 1.4.3.", + [UI_MENU_FREECAM_PAD_V143] = "Только для версии игры 1.4.3", [UI_MENU_GROUP_GAMEPLAY_TWEAKS] = "Геймплей", [UI_MENU_GAMEPLAY_TWEAKS_ENABLED] = "Настройки геймплея", [UI_MENU_GAMEPLAY_TWEAKS_ENABLED_DESC] = "Управление колесом мыши: вращение и дистанция предметов в Ультраруке, выбор оружия и предметов, плавный зум карты.", @@ -1771,6 +1781,12 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = { [UI_MENU_WALK_SCALE] = "Intensidade do andar", [UI_MENU_WALK_SCALE_DESC] = "A inclinação dos analógicos do teclado enquanto a tecla de andar está segura. Metade " "é andar, a inclinação total é correr.", + [UI_MENU_FREECAM_PAD] = "Combinação da câmera livre", + [UI_MENU_FREECAM_PAD_DESC] = "Botões do controle pressionados juntos que soltam a câmera do Link e a trazem de " + "volta. Enquanto ela está ligada o jogo não recebe comandos: o analógico esquerdo voa na direção da visão e " + "para os lados, os gatilhos sobem e descem, o analógico direito gira, e cada toque em L ou R reduz a " + "velocidade à metade ou a dobra. Versão do jogo 1.4.3.", + [UI_MENU_FREECAM_PAD_V143] = "Só na versão 1.4.3 do jogo", [UI_MENU_GROUP_GAMEPLAY_TWEAKS] = "Ajustes de jogabilidade", [UI_MENU_GAMEPLAY_TWEAKS_ENABLED] = "Ajustes de jogabilidade", [UI_MENU_GAMEPLAY_TWEAKS_ENABLED_DESC] = "Controles com a roda do mouse para rotação e distância na Ultramão, seleção de armas e itens, e zoom suave no mapa.", @@ -2520,6 +2536,9 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = { [UI_MENU_WALK_KEY_TAKEN] = "同时为 %s", [UI_MENU_WALK_SCALE] = "步行幅度", [UI_MENU_WALK_SCALE_DESC] = "按住步行键时键盘摇杆的推动幅度。一半为走路,推满为奔跑。", + [UI_MENU_FREECAM_PAD] = "自由镜头组合键", + [UI_MENU_FREECAM_PAD_DESC] = "同时按下的手柄按键,让镜头脱离林克,再按一次回到林克。开启期间游戏不接收输入:左摇杆沿视线方向和左右移动,扳机键上升和下降,右摇杆转动视角,每按一次 L 或 R 速度减半或加倍。游戏版本 1.4.3。", + [UI_MENU_FREECAM_PAD_V143] = "仅限游戏版本 1.4.3", [UI_MENU_GROUP_GAMEPLAY_TWEAKS] = "游戏操作微调", [UI_MENU_GAMEPLAY_TWEAKS_ENABLED] = "启用操作微调", [UI_MENU_GAMEPLAY_TWEAKS_ENABLED_DESC] = "使用鼠标滚轮控制究极手物体旋转与距离、武器与道具切换以及地图平滑缩放。", diff --git a/runtime/ui_text.h b/runtime/ui_text.h index 51c8c2db..ca75c70e 100644 --- a/runtime/ui_text.h +++ b/runtime/ui_text.h @@ -154,6 +154,7 @@ typedef enum { UI_QS_SAVED, UI_QS_LOADING, UI_QS_NOT_NOW, UI_QS_NONE, UI_QS_FAILED, UI_QS_LOAD_FAILED, UI_MENU_MOUSE_SENS, UI_MENU_MOUSE_SENS_DESC, UI_MENU_WALK_KEY, UI_MENU_WALK_KEY_DESC, UI_MENU_WALK_KEY_TAKEN, UI_MENU_WALK_SCALE, UI_MENU_WALK_SCALE_DESC, + UI_MENU_FREECAM_PAD, UI_MENU_FREECAM_PAD_DESC, UI_MENU_FREECAM_PAD_V143, // Controls tab: Gameplay tweaks UI_MENU_GROUP_GAMEPLAY_TWEAKS,