From 56ecf6d332ac3feab562b4f60bf38b0d677f594f Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 18 May 2025 20:41:42 +0200 Subject: [PATCH] Mainmenu: Fix error after ESC in dialog windows (#16130) The error was caused by fd857374, where 'MenuQuit' was processed after 'try_quit'. This commit fixes the error by moving the special 'MenuQuit' handling to Lua. --- builtin/fstk/ui.lua | 4 ++++ src/gui/guiFormSpecMenu.cpp | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/fstk/ui.lua b/builtin/fstk/ui.lua index 47b9d086c..44d2ab3d8 100644 --- a/builtin/fstk/ui.lua +++ b/builtin/fstk/ui.lua @@ -166,6 +166,10 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- core.button_handler = function(fields) + if fields["try_quit"] and not fields["key_enter"] then + core.event_handler("MenuQuit") + return + end if fields["btn_reconnect_yes"] then gamedata.reconnect_requested = false gamedata.errormessage = nil diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp index cee066131..4b9601430 100644 --- a/src/gui/guiFormSpecMenu.cpp +++ b/src/gui/guiFormSpecMenu.cpp @@ -4053,7 +4053,6 @@ void GUIFormSpecMenu::tryClose() quitMenu(); } else { acceptInput(quit_mode_try); - m_text_dst->gotText(L"MenuQuit"); } }