mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Don't update every frame
Don't update completion callback every frame, only when the input has changed.
This commit is contained in:
parent
a8ef2b74cd
commit
116d2acae8
@ -478,13 +478,6 @@ void CConsole::SuggestPanel(void)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CConsole::AutoComplete(void)
|
||||
{
|
||||
// Show ConVar/ConCommand suggestions when something has been entered.
|
||||
if (!m_szInputBuf[0])
|
||||
{
|
||||
ResetAutoComplete();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Don't suggest if user tries to assign value to ConVar or execute ConCommand.
|
||||
if (!m_szInputBuf[0] || strstr(m_szInputBuf, ";"))
|
||||
{
|
||||
@ -496,18 +489,12 @@ bool CConsole::AutoComplete(void)
|
||||
{
|
||||
if (m_bCanAutoComplete)
|
||||
{
|
||||
m_bCanAutoComplete = false;
|
||||
FindFromPartial();
|
||||
}
|
||||
if (m_vSuggest.empty())
|
||||
{
|
||||
ResetAutoComplete();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else // Command completion callback.
|
||||
else if (m_bCanAutoComplete) // Command completion callback.
|
||||
{
|
||||
m_vSuggest.clear();
|
||||
ClearAutoComplete();
|
||||
string svCommand;
|
||||
|
||||
for (size_t i = 0; i < sizeof(m_szInputBuf); i++)
|
||||
@ -546,6 +533,12 @@ bool CConsole::AutoComplete(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_vSuggest.empty())
|
||||
{
|
||||
ResetAutoComplete();
|
||||
return false;
|
||||
}
|
||||
|
||||
m_bSuggestActive = true;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user