mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Strip tilde/grave/space characters from console properly
If input only contains the '~', '`' or ' ' character, it gets stripped from the input buffer. e.g. '````````' or '~' gets stripped, but 'script_ui printl("test `````")' or 'script_client printl("~CEngineClient()")' does not.
This commit is contained in:
parent
2eda8235b7
commit
609af5e4b7
@ -765,6 +765,20 @@ int CConsole::TextEditCallback(ImGuiInputTextCallbackData* iData)
|
||||
}
|
||||
case ImGuiInputTextFlags_CallbackEdit:
|
||||
{
|
||||
for (size_t i = 0, n = strlen(iData->Buf); i < n; i++)
|
||||
{
|
||||
if (iData->Buf[i] != '~'
|
||||
&& iData->Buf[i] != '`'
|
||||
&& iData->Buf[i] != ' ')
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (i == (n - 1))
|
||||
{
|
||||
iData->DeleteChars(0, n);
|
||||
}
|
||||
}
|
||||
|
||||
m_bCanAutoComplete = true;
|
||||
BuildSummary(iData->Buf);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user