From d570683b5ac94222063e37ab643f115ad5da3873 Mon Sep 17 00:00:00 2001 From: def Date: Fri, 24 Jul 2015 01:28:15 +0200 Subject: [PATCH] TAB in console doesn't influence menu (fixes #239) --- src/game/client/components/console.cpp | 8 -------- src/game/client/components/console.h | 10 ++++++++++ src/game/client/components/menus_browser.cpp | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index 16121344c..87fcafb8b 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -31,14 +31,6 @@ #include "console.h" -enum -{ - CONSOLE_CLOSED, - CONSOLE_OPENING, - CONSOLE_OPEN, - CONSOLE_CLOSING, -}; - CGameConsole::CInstance::CInstance(int Type) { m_pHistoryEntry = 0x0; diff --git a/src/game/client/components/console.h b/src/game/client/components/console.h index 6e8d461d3..05ffb70f4 100644 --- a/src/game/client/components/console.h +++ b/src/game/client/components/console.h @@ -6,6 +6,14 @@ #include #include +enum +{ + CONSOLE_CLOSED, + CONSOLE_OPENING, + CONSOLE_OPEN, + CONSOLE_CLOSING, +}; + class CGameConsole : public CComponent { class CInstance @@ -99,5 +107,7 @@ public: virtual void OnRender(); virtual void OnMessage(int MsgType, void *pRawMsg); virtual bool OnInput(IInput::CEvent Events); + + bool IsClosed() { return m_ConsoleState == CONSOLE_CLOSED; } }; #endif diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index d7a5969a1..062193103 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "menus.h" @@ -173,7 +174,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) else ScrollNum = 0; - if(Input()->KeyDown(KEY_TAB)) + if(Input()->KeyDown(KEY_TAB) && m_pClient->m_pGameConsole->IsClosed()) { if(Input()->KeyPressed(KEY_LSHIFT) || Input()->KeyPressed(KEY_RSHIFT)) g_Config.m_UiToolboxPage = (g_Config.m_UiToolboxPage + 3 - 1) % 3;