skip text input when the console is open. (#1465)

This commit is contained in:
oy 2017-09-13 19:15:34 +02:00
parent 0df247a925
commit bd84c98893
3 changed files with 14 additions and 4 deletions

View file

@ -673,6 +673,11 @@ void CGameConsole::ConchainConsoleOutputLevelUpdate(IConsole::IResult *pResult,
} }
} }
bool CGameConsole::IsConsoleActive()
{
return m_ConsoleState != CONSOLE_CLOSED;
}
void CGameConsole::PrintLine(int Type, const char *pLine) void CGameConsole::PrintLine(int Type, const char *pLine)
{ {
if(Type == CONSOLETYPE_LOCAL) if(Type == CONSOLETYPE_LOCAL)

View file

@ -90,6 +90,7 @@ public:
CGameConsole(); CGameConsole();
bool IsConsoleActive();
void PrintLine(int Type, const char *pLine); void PrintLine(int Type, const char *pLine);
virtual void OnStateChange(int NewState, int OldState); virtual void OnStateChange(int NewState, int OldState);

View file

@ -21,6 +21,7 @@
#include <generated/client_data.h> #include <generated/client_data.h>
#include <game/client/components/camera.h> #include <game/client/components/camera.h>
#include <game/client/components/console.h>
#include <game/client/components/sounds.h> #include <game/client/components/sounds.h>
#include <game/client/gameclient.h> #include <game/client/gameclient.h>
#include <game/client/lineinput.h> #include <game/client/lineinput.h>
@ -447,6 +448,8 @@ int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrS
} }
} }
if(!m_pClient->m_pGameConsole->IsConsoleActive())
{
for(int i = 0; i < Input()->NumEvents(); i++) for(int i = 0; i < Input()->NumEvents(); i++)
{ {
Len = str_length(pStr); Len = str_length(pStr);
@ -454,6 +457,7 @@ int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrS
ReturnValue |= CLineInput::Manipulate(Input()->GetEvent(i), pStr, StrSize, StrSize, &Len, &s_AtIndex, &NumChars); ReturnValue |= CLineInput::Manipulate(Input()->GetEvent(i), pStr, StrSize, StrSize, &Len, &s_AtIndex, &NumChars);
} }
} }
}
bool JustGotActive = false; bool JustGotActive = false;