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)
{
if(Type == CONSOLETYPE_LOCAL)

View file

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

View file

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