mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +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,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue