From 95c6dc58d3cd44d54e06b388cf9c028f177adeed Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 5 Jan 2024 11:42:10 -0800 Subject: [PATCH] Fix TAB bind conflict with translator & debugger The TAB bind is used in both roomname translator mode and the level debugger. To fix this, the TAB keybind will prioritize roomname translator mode, unless the debugger text is enabled (with the Y keybind), in which case the debugger takes priority. Additionally, the roomname translator text will not render when the debugger text is shown. Fixes #1094. --- desktop_version/src/RoomnameTranslator.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/RoomnameTranslator.cpp b/desktop_version/src/RoomnameTranslator.cpp index 5c1585d9..209cdd18 100644 --- a/desktop_version/src/RoomnameTranslator.cpp +++ b/desktop_version/src/RoomnameTranslator.cpp @@ -6,6 +6,7 @@ #include "Graphics.h" #include "GraphicsUtil.h" #include "KeyPoll.h" +#include "LevelDebugger.h" #include "Localization.h" #include "LocalizationMaint.h" #include "Map.h" @@ -51,6 +52,11 @@ namespace roomname_translator void overlay_render(bool* force_roomname_hidden, bool* roomname_untranslated, int* roomname_r, int* roomname_g, int* roomname_b) { + if (level_debugger::is_active()) + { + return; + } + if (edit_mode || help_screen) { fullscreen_rect.x = 0; @@ -369,7 +375,7 @@ namespace roomname_translator help_screen = true; } - if (key_pressed_once(SDLK_TAB, &held_tab)) + if (key_pressed_once(SDLK_TAB, &held_tab) && !level_debugger::is_active()) { edit_mode = !edit_mode; }