From b403edb804349a8416aae4d3225beb8a20784a86 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 15 Mar 2022 00:03:57 -0400 Subject: [PATCH] ImGuiEntitySupport: Support modifying area attributes in real time --- Runtime/ImGuiEntitySupport.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Runtime/ImGuiEntitySupport.cpp b/Runtime/ImGuiEntitySupport.cpp index 9509975af..4975e3a3f 100644 --- a/Runtime/ImGuiEntitySupport.cpp +++ b/Runtime/ImGuiEntitySupport.cpp @@ -429,10 +429,22 @@ IMGUI_ENTITY_INSPECT(CScriptAreaAttributes, CEntity, ScriptAreaAttributes, { ImGui::SameLine(); ImGui::Text("(Asset: 0x%08X)", int(x4c_skybox.Value())); ImGuiEnumInput("Env FX Type", x38_envFx); - ImGui::SliderFloat("Env FX Density", &x3c_envFxDensity, 0.f, 1.f); - ImGui::SliderFloat("Thermal Heat", &x40_thermalHeat, 0.f, 1.f); + if (ImGui::SliderFloat("Env FX Density", &x3c_envFxDensity, 0.f, 1.f)) { + g_StateManager->GetEnvFxManager()->SetFxDensity(500, x3c_envFxDensity); + } + if (ImGui::SliderFloat("Thermal Heat", &x40_thermalHeat, 0.f, 1.f)) { + CGameArea* area = g_StateManager->GetWorld()->GetArea(x4_areaId); + if (area != nullptr && area->IsPostConstructed()) { + area->GetPostConstructed()->x111c_thermalCurrent = x40_thermalHeat; + } + } ImGui::SliderFloat("X-Ray Fog Distance", &x44_xrayFogDistance, 0.f, 1.f); - ImGui::SliderFloat("World Lighting Level", &x48_worldLightingLevel, 0.f, 1.f); + if (ImGui::SliderFloat("World Lighting Level", &x48_worldLightingLevel, 0.f, 1.f)) { + CGameArea* area = g_StateManager->GetWorld()->GetArea(x4_areaId); + if (area != nullptr && area->IsPostConstructed()) { + area->GetPostConstructed()->x1128_worldLightingLevel = x48_worldLightingLevel; + } + } ImGuiEnumInput("Phazon Type", x50_phazon); }) IMGUI_ENTITY_INSPECT(CScriptCameraBlurKeyframe, CEntity, ScriptCameraBlurKeyframe, {})