mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 16:30:32 +00:00
Added ImGui.ShowDemo console variable to show/hide ImGui demo.
This commit is contained in:
parent
00ad746267
commit
8c46591488
@ -6,8 +6,19 @@
|
|||||||
#include "ImGuiModuleManager.h"
|
#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.
|
// Demo copied from ImGui examples. See https://github.com/ocornut/imgui.
|
||||||
void FImGuiDemo::DrawControls()
|
void FImGuiDemo::DrawControls()
|
||||||
|
{
|
||||||
|
if (CVars::ShowDemo.GetValueOnGameThread() > 0)
|
||||||
{
|
{
|
||||||
// 1. Show a simple window
|
// 1. Show a simple window
|
||||||
// Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
|
// 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);
|
ImGui::ShowTestWindow(&bDemoShowTestWindow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user