From 2a9003ae45cc82f18a6d3056430a16b7cf6cc50d Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 9 Jan 2024 21:03:03 -0800 Subject: [PATCH] Reverse left & right nav keys in editor for RTL If the language is RTL, then the left and right menu navigation keys should be reversed, because the menu layout goes from right to left. This is to be consistent with the other menus in the game. The editor is just a special case so it was overlooked. --- desktop_version/src/Editor.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Editor.cpp b/desktop_version/src/Editor.cpp index cae7d73b..29124e59 100644 --- a/desktop_version/src/Editor.cpp +++ b/desktop_version/src/Editor.cpp @@ -3524,11 +3524,23 @@ void editorinput(void) if (game.menustart) { - if (game.press_left || up_pressed) + bool left, right; + if (!font::is_rtl(PR_FONT_INTERFACE)) + { + left = game.press_left; + right = game.press_right; + } + else + { + left = game.press_right; + right = game.press_left; + } + + if (left || up_pressed) { game.currentmenuoption--; } - else if (game.press_right || down_pressed) + else if (right || down_pressed) { game.currentmenuoption++; }