mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
skip text input when the console is open. (#1465)
This commit is contained in:
parent
0df247a925
commit
bd84c98893
|
@ -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)
|
||||
|
|
|
@ -90,6 +90,7 @@ public:
|
|||
|
||||
CGameConsole();
|
||||
|
||||
bool IsConsoleActive();
|
||||
void PrintLine(int Type, const char *pLine);
|
||||
|
||||
virtual void OnStateChange(int NewState, int OldState);
|
||||
|
|
|
@ -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,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++)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool JustGotActive = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue