mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-05 15:18:47 +00:00
CogEngine: Fix command list of console widget staying when deactivating imgui input
This commit is contained in:
@@ -70,6 +70,11 @@ void FCogEngineWindow_Console::RenderContent()
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Console::RenderTick(float DeltaTime)
|
void FCogEngineWindow_Console::RenderTick(float DeltaTime)
|
||||||
{
|
{
|
||||||
|
if (GetOwner()->GetContext().GetEnableInput() == false)
|
||||||
|
{
|
||||||
|
WidgetMode_OpenCommandList = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (WidgetMode_OpenCommandList)
|
if (WidgetMode_OpenCommandList)
|
||||||
{
|
{
|
||||||
bIsWidgetMode = true;
|
bIsWidgetMode = true;
|
||||||
@@ -79,13 +84,13 @@ void FCogEngineWindow_Console::RenderTick(float DeltaTime)
|
|||||||
ImGui::SetNextWindowSize(ImVec2(Config->WidgetWidth, ImGui::GetFontSize() * 30), ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowSize(ImVec2(Config->WidgetWidth, ImGui::GetFontSize() * 30), ImGuiCond_FirstUseEver);
|
||||||
ImGui::SetNextWindowPos(WidgetMode_CommandListPosition, ImGuiCond_Always);
|
ImGui::SetNextWindowPos(WidgetMode_CommandListPosition, ImGuiCond_Always);
|
||||||
|
|
||||||
ImGuiWindowFlags flags =
|
ImGuiWindowFlags Flags =
|
||||||
ImGuiWindowFlags_NoTitleBar
|
ImGuiWindowFlags_NoTitleBar
|
||||||
| ImGuiWindowFlags_NoMove
|
| ImGuiWindowFlags_NoMove
|
||||||
| ImGuiWindowFlags_NoFocusOnAppearing; // We want the console input text to keep the focus.
|
| ImGuiWindowFlags_NoFocusOnAppearing; // We want the console input text to keep the focus.
|
||||||
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
const bool IsCommandListWindowVisible = ImGui::Begin("ConsoleCommandList", nullptr, flags);
|
const bool IsCommandListWindowVisible = ImGui::Begin("ConsoleCommandList", nullptr, Flags);
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
|
|
||||||
if (IsCommandListWindowVisible)
|
if (IsCommandListWindowVisible)
|
||||||
|
|||||||
Reference in New Issue
Block a user