diff --git a/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Console.cpp b/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Console.cpp index fa251d2..12e0135 100644 --- a/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Console.cpp +++ b/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Console.cpp @@ -68,16 +68,22 @@ void FCogEngineWindow_Console::RenderMainMenuWidget() TooltipPos.y += Window->MenuBarHeight; ImGui::SetNextItemWidth(Config->WidgetWidth); - RenderInput(); + RenderInput(); + const bool IsTextInputActive = ImGui::IsItemActive(); + if (Config->FocusWidgetWhenAppearing && ImGui::IsWindowAppearing()) { SelectedCommandIndex = -1; RefreshCommandList(); ImGui::ActivateItemByID(InputIdOnWidgetMode); } - - const bool IsTextInputActive = ImGui::IsItemActive(); + + if (ImGui::BeginPopupContextItem()) + { + RenderMenu(); + ImGui::EndPopup(); + } if (bPopupCommandListOnWidgetMode) { @@ -111,12 +117,6 @@ void FCogEngineWindow_Console::RenderMainMenuWidget() ImGui::End(); ImGui::PopStyleVar(); } - - if (ImGui::BeginPopupContextWindow()) - { - RenderMenu(); - ImGui::EndPopup(); - } bIsRenderingWidget = false; }