From bdc19308dd79ce48870bd7ac1222ebb4f911dde1 Mon Sep 17 00:00:00 2001 From: Dawva Date: Tue, 14 Oct 2025 13:59:46 +0300 Subject: [PATCH 1/2] fixed the help menu, it will now show the correct input for the action Show --- src/lang.h | 19 +++++++++++++++++-- src/ui.h | 5 ++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/lang.h b/src/lang.h index 9f813d8b..3bbaccc3 100644 --- a/src/lang.h +++ b/src/lang.h @@ -291,13 +291,14 @@ enum StringID { #define STR_SCALE "25", "50", "75", "100" -const char *helpText = +static char helpText[1024]; +const char *helpTextFormat = "Start - add second player or restore Lara@" "H - Show or hide this help@" "ALT and ENTER - Fullscreen@" "5 - Save Game@" "9 - Load Game@" - "C - Look@" + "%s - Look@" "R - Slow motion@" "T - Fast motion@" "Roll - Up & Down@" @@ -310,6 +311,20 @@ const char *helpText = "DOZY on - Look & Duck & Action & Jump@" "DOZY off - Walk@" "Free Camera - hold L & R stick"; +inline const char* getKeyName(InputKey key) { + static const char* keyNames[] = { + STR_KEYS + }; + if ((int)key >= 0 && (int)key < COUNT(keyNames)) + return keyNames[(int)key]; + return "UNKNOWN"; +} + +inline void updateHelpText() { + InputKey lookKey = (InputKey)Core::settings.controls[0].keys[cLook].key; + const char* keyName = getKeyName(lookKey); + sprintf(helpText, helpTextFormat, keyName); +} #include "lang/en.h" #include "lang/fr.h" diff --git a/src/ui.h b/src/ui.h index 03cf736b..76912c61 100644 --- a/src/ui.h +++ b/src/ui.h @@ -4,6 +4,7 @@ #include "core.h" #include "mesh.h" #include "controller.h" +#define UI_SHOW_FPS #define PICKUP_SHOW_TIME 5.0f #define SUBTITLES_SPEED 0.1f @@ -541,6 +542,7 @@ namespace UI { void init(IGame *game) { ensureLanguage(Core::settings.audio.language); + updateHelpText(); UI::game = game; showHelp = false; helpTipTime = 5.0f; @@ -635,6 +637,7 @@ namespace UI { if (Input::down[ikH]) { Input::down[ikH] = false; showHelp = !showHelp; + updateHelpText(); helpTipTime = 0.0f; } if (helpTipTime > 0.0f) @@ -726,7 +729,7 @@ namespace UI { #if defined(_OS_WEB) || defined(_OS_WIN) || defined(_OS_LINUX) || defined(_OS_MAC) || defined(_OS_RPI) if (showHelp) { - textOut(vec2(32, 32), STR_HELP_TEXT, aLeft, width - 32, 255, UI::SHADE_GRAY); + textOut(vec2(32, 32), helpText, aLeft, width - 32, 255, UI::SHADE_GRAY); } else { if (helpTipTime > 0.0f) { textOut(vec2(0, height - 16), STR_HELP_PRESS, aCenter, width, 255, UI::SHADE_ORANGE); From 149693539b981ce10fa69471199aa56c202f1baf Mon Sep 17 00:00:00 2001 From: Dawva Date: Tue, 14 Oct 2025 14:11:55 +0300 Subject: [PATCH 2/2] removed FPS to show automatically --- src/ui.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui.h b/src/ui.h index 76912c61..a7b73849 100644 --- a/src/ui.h +++ b/src/ui.h @@ -4,7 +4,6 @@ #include "core.h" #include "mesh.h" #include "controller.h" -#define UI_SHOW_FPS #define PICKUP_SHOW_TIME 5.0f #define SUBTITLES_SPEED 0.1f