Reset scroll position when AutoSuggest has updated

This commit is contained in:
Amos 2022-01-20 00:24:41 +01:00
parent df3bfafce6
commit 963c189f35
3 changed files with 9 additions and 1 deletions

View File

@ -315,6 +315,12 @@ void CConsole::SuggestPanel(void)
m_bSuggestMoved = false;
}
}
if (m_bSuggestUpdate)
{
ImGui::SetScrollHereY(0.f);
m_bSuggestUpdate = false;
}
}
ImGui::PopAllowKeyboardFocus();
@ -364,6 +370,7 @@ bool CConsole::CanAutoComplete(void)
void CConsole::FindFromPartial(void)
{
m_nSuggestPos = -1;
m_bSuggestUpdate = true;
m_vsvSuggest.clear();
for (int i = 0; i < g_vsvAllConVars.size(); i++)

View File

@ -21,6 +21,7 @@ private:
std::vector<std::string> m_vsvSuggest;
bool m_bSuggestActive = false;
bool m_bSuggestMoved = false;
bool m_bSuggestUpdate = false;
int m_nSuggestPos = -1;
ImVec2 m_vecSuggestWindowPos;

View File

@ -76,7 +76,7 @@ void ConVar::Init(void)
cl_gpustats_offset_x = new ConVar("cl_gpustats_offset_x", "1250", FCVAR_DEVELOPMENTONLY, "X offset for texture streaming debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
cl_gpustats_offset_y = new ConVar("cl_gpustats_offset_y", "900", FCVAR_DEVELOPMENTONLY, "Y offset for texture streaming debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
con_suggestion_limit = new ConVar("con_suggestion_limit", "40", FCVAR_DEVELOPMENTONLY, "Maximum number of suggestions the autocomplete window will show for the console.", false, 0.f, false, 0.f, nullptr, nullptr);
con_suggestion_limit = new ConVar("con_suggestion_limit", "120", FCVAR_DEVELOPMENTONLY, "Maximum number of suggestions the autocomplete window will show for the console.", false, 0.f, false, 0.f, nullptr, nullptr);
con_suggestion_helptext = new ConVar("con_suggestion_helptext", "0", FCVAR_DEVELOPMENTONLY, "Show ConVar help text in autocomplete window. Disabled by default to keep window less populated.", false, 0.f, false, 0.f, nullptr, nullptr);
//-------------------------------------------------------------------------
// FILESYSTEM |