From 26b99359d69c146e3c89ad1d5dfa87c02e84516d Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 29 Feb 2024 13:19:10 +0100 Subject: [PATCH] ImGui: fix console input suggestions bug Don't draw the suggestions window if the console has been collapsed. --- r5dev/gameui/IConsole.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/r5dev/gameui/IConsole.cpp b/r5dev/gameui/IConsole.cpp index d1245c7f..1bd3f70e 100644 --- a/r5dev/gameui/IConsole.cpp +++ b/r5dev/gameui/IConsole.cpp @@ -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 * **************************/