Added ImGui.ShowDemo console variable to show/hide ImGui demo.

This commit is contained in:
Sebastian 2017-10-03 21:26:59 +01:00
parent 00ad746267
commit 8c46591488

View File

@ -6,8 +6,19 @@
#include "ImGuiModuleManager.h"
namespace CVars
{
TAutoConsoleVariable<int> ShowDemo(TEXT("ImGui.ShowDemo"), 0,
TEXT("Show ImGui demo.\n")
TEXT("0: disabled (default)\n")
TEXT("1: enabled."),
ECVF_Default);
}
// Demo copied from ImGui examples. See https://github.com/ocornut/imgui.
void FImGuiDemo::DrawControls()
{
if (CVars::ShowDemo.GetValueOnGameThread() > 0)
{
// 1. Show a simple window
// Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
@ -37,3 +48,4 @@ void FImGuiDemo::DrawControls()
ImGui::ShowTestWindow(&bDemoShowTestWindow);
}
}
}