From 6aa03c878e43eb1756ae9c0e2d66baeb4f50d211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Mon, 5 Jun 2023 16:56:07 +0200 Subject: [PATCH] Fix escape not working in settings menu anymore The color picker was always consuming the escape hotkey even when already disabled. Regression from #6705 due to changed order of hotkey consumption. --- src/game/client/components/menus.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 1b570ddd6..3724f5f1c 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1072,15 +1072,16 @@ bool CMenus::CanDisplayWarning() void CMenus::RenderColorPicker() { + if(!ms_ColorPicker.m_Active) + return; + if(UI()->ConsumeHotkey(CUI::HOTKEY_ESCAPE)) { ms_ColorPicker.m_Active = false; ms_ValueSelectorTextMode = false; UI()->SetActiveItem(nullptr); - } - - if(!ms_ColorPicker.m_Active) return; + } // First check if we should disable color picker CUIRect PickerRect;