ImGui: fix console input suggestions bug

Don't draw the suggestions window if the console has been collapsed.
This commit is contained in:
Kawe Mazidjatari 2024-02-29 13:19:10 +01:00
parent 8f09ac1b86
commit 4578401f33

View File

@ -128,6 +128,8 @@ void CConsole::RunFrame(void)
//ImGui::ShowDemoWindow();
}
bool drawn = false;
/**************************
* BASE PANEL SETUP *
**************************/
@ -169,10 +171,14 @@ void CConsole::RunFrame(void)
}
ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(flWidth, flHeight)); nVars++;
DrawSurface();
drawn = DrawSurface();
ImGui::PopStyleVar(nVars);
}
// If we didn't draw the console, don't draw the suggest panel
if (!drawn)
return;
/**************************
* SUGGESTION PANEL SETUP *
**************************/