From f21f041edfee5fa2fcd92bb38c5a984dafe28d54 Mon Sep 17 00:00:00 2001 From: SkrubbySkrubInAShrub Date: Thu, 16 Apr 2026 14:12:39 +0200 Subject: [PATCH 1/3] fix(weather-editor): remove time of day for lighting templates. --- .../Weather/LightingTemplateWidget.cpp | 70 +++++-------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/src/WeatherEditor/Weather/LightingTemplateWidget.cpp b/src/WeatherEditor/Weather/LightingTemplateWidget.cpp index 0be0776a20..bdf9dc0843 100644 --- a/src/WeatherEditor/Weather/LightingTemplateWidget.cpp +++ b/src/WeatherEditor/Weather/LightingTemplateWidget.cpp @@ -159,59 +159,25 @@ void LightingTemplateWidget::DrawDALCSettings() { bool changed = false; - if (ImGui::CollapsingHeader("Basic DALC", ImGuiTreeNodeFlags_DefaultOpen)) { - ImGui::Spacing(); - if (WeatherUtils::DrawColorEdit("Specular", settings.dalc.specular)) - changed = true; - ImGui::Spacing(); - if (WeatherUtils::DrawSliderFloat("Fresnel Power", settings.dalc.fresnelPower)) - changed = true; - ImGui::Spacing(); - } + ImGui::SeparatorText("Directional Ambient Lighting (DALC)"); + if (WeatherUtils::DrawColorEdit("Specular", settings.dalc.specular)) + changed = true; + if (WeatherUtils::DrawSliderFloat("Fresnel Power", settings.dalc.fresnelPower)) + changed = true; - if (ImGui::CollapsingHeader("Directional Colors (Time of Day)", ImGuiTreeNodeFlags_DefaultOpen)) { - // Note: The game engine uses X, Y, Z to represent time periods - // We map them to: X=Sunrise/Day, Y=Sunset, Z=Night for TOD display - - if (TOD::BeginTODTable("DALCDirectionalTable")) { - TOD::RenderTODHeader(); - TOD::DrawTODSeparator(); - - // Prepare arrays for TOD rendering (map X,Y,Z to Sunrise,Day,Sunset,Night) - float3 maxColors[4]; - float3 minColors[4]; - - // Map X (index 0) to Sunrise and Day - maxColors[TOD::Sunrise] = settings.dalc.directional[0].max; - maxColors[TOD::Day] = settings.dalc.directional[0].max; - minColors[TOD::Sunrise] = settings.dalc.directional[0].min; - minColors[TOD::Day] = settings.dalc.directional[0].min; - - // Map Y (index 1) to Sunset - maxColors[TOD::Sunset] = settings.dalc.directional[1].max; - minColors[TOD::Sunset] = settings.dalc.directional[1].min; - - // Map Z (index 2) to Night - maxColors[TOD::Night] = settings.dalc.directional[2].max; - minColors[TOD::Night] = settings.dalc.directional[2].min; - - if (TOD::DrawTODColorRow("Positive Direction (+)", maxColors)) { - settings.dalc.directional[0].max = maxColors[TOD::Sunrise]; // X from Sunrise - settings.dalc.directional[1].max = maxColors[TOD::Sunset]; // Y from Sunset - settings.dalc.directional[2].max = maxColors[TOD::Night]; // Z from Night - changed = true; - } - - if (TOD::DrawTODColorRow("Negative Direction (-)", minColors)) { - settings.dalc.directional[0].min = minColors[TOD::Sunrise]; // X from Sunrise - settings.dalc.directional[1].min = minColors[TOD::Sunset]; // Y from Sunset - settings.dalc.directional[2].min = minColors[TOD::Night]; // Z from Night - changed = true; - } - - TOD::EndTODTable(); - } - } + ImGui::SeparatorText("Directional Colors"); + if (MatchesSearch("X+ (Right)") && WeatherUtils::DrawColorEdit("X+ (Right)", settings.dalc.directional[0].max)) + changed = true; + if (MatchesSearch("X- (Left)") && WeatherUtils::DrawColorEdit("X- (Left)", settings.dalc.directional[0].min)) + changed = true; + if (MatchesSearch("Y+ (Front)") && WeatherUtils::DrawColorEdit("Y+ (Front)", settings.dalc.directional[1].max)) + changed = true; + if (MatchesSearch("Y- (Back)") && WeatherUtils::DrawColorEdit("Y- (Back)", settings.dalc.directional[1].min)) + changed = true; + if (MatchesSearch("Z+ (Up)") && WeatherUtils::DrawColorEdit("Z+ (Up)", settings.dalc.directional[2].max)) + changed = true; + if (MatchesSearch("Z- (Down)") && WeatherUtils::DrawColorEdit("Z- (Down)", settings.dalc.directional[2].min)) + changed = true; if (changed && EditorWindow::GetSingleton()->settings.autoApplyChanges) { ApplyChanges(); From 391948c28d99ebc9fb498b13bc9643de40e75a4a Mon Sep 17 00:00:00 2001 From: SkrubbySkrubInAShrub Date: Thu, 16 Apr 2026 14:22:02 +0200 Subject: [PATCH 2/3] fix: address AI comment --- src/WeatherEditor/Weather/LightingTemplateWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WeatherEditor/Weather/LightingTemplateWidget.cpp b/src/WeatherEditor/Weather/LightingTemplateWidget.cpp index bdf9dc0843..fc77ba261c 100644 --- a/src/WeatherEditor/Weather/LightingTemplateWidget.cpp +++ b/src/WeatherEditor/Weather/LightingTemplateWidget.cpp @@ -160,9 +160,9 @@ void LightingTemplateWidget::DrawDALCSettings() bool changed = false; ImGui::SeparatorText("Directional Ambient Lighting (DALC)"); - if (WeatherUtils::DrawColorEdit("Specular", settings.dalc.specular)) + if (MatchesSearch("Specular") && WeatherUtils::DrawColorEdit("Specular", settings.dalc.specular)) changed = true; - if (WeatherUtils::DrawSliderFloat("Fresnel Power", settings.dalc.fresnelPower)) + if (MatchesSearch("Fresnel Power") && WeatherUtils::DrawSliderFloat("Fresnel Power", settings.dalc.fresnelPower)) changed = true; ImGui::SeparatorText("Directional Colors"); From 69cdd32391ab79b492cd499886c41c819e32b7b8 Mon Sep 17 00:00:00 2001 From: SkrubbySkrubInAShrub Date: Thu, 16 Apr 2026 14:30:07 +0200 Subject: [PATCH 3/3] fix: address AI nitpick --- src/WeatherEditor/Weather/LightingTemplateWidget.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WeatherEditor/Weather/LightingTemplateWidget.cpp b/src/WeatherEditor/Weather/LightingTemplateWidget.cpp index fc77ba261c..e43b8a47b8 100644 --- a/src/WeatherEditor/Weather/LightingTemplateWidget.cpp +++ b/src/WeatherEditor/Weather/LightingTemplateWidget.cpp @@ -166,17 +166,17 @@ void LightingTemplateWidget::DrawDALCSettings() changed = true; ImGui::SeparatorText("Directional Colors"); - if (MatchesSearch("X+ (Right)") && WeatherUtils::DrawColorEdit("X+ (Right)", settings.dalc.directional[0].max)) + if ((MatchesSearch("Directional") || MatchesSearch("X+ (Right)")) && WeatherUtils::DrawColorEdit("X+ (Right)", settings.dalc.directional[0].max)) changed = true; - if (MatchesSearch("X- (Left)") && WeatherUtils::DrawColorEdit("X- (Left)", settings.dalc.directional[0].min)) + if ((MatchesSearch("Directional") || MatchesSearch("X- (Left)")) && WeatherUtils::DrawColorEdit("X- (Left)", settings.dalc.directional[0].min)) changed = true; - if (MatchesSearch("Y+ (Front)") && WeatherUtils::DrawColorEdit("Y+ (Front)", settings.dalc.directional[1].max)) + if ((MatchesSearch("Directional") || MatchesSearch("Y+ (Front)")) && WeatherUtils::DrawColorEdit("Y+ (Front)", settings.dalc.directional[1].max)) changed = true; - if (MatchesSearch("Y- (Back)") && WeatherUtils::DrawColorEdit("Y- (Back)", settings.dalc.directional[1].min)) + if ((MatchesSearch("Directional") || MatchesSearch("Y- (Back)")) && WeatherUtils::DrawColorEdit("Y- (Back)", settings.dalc.directional[1].min)) changed = true; - if (MatchesSearch("Z+ (Up)") && WeatherUtils::DrawColorEdit("Z+ (Up)", settings.dalc.directional[2].max)) + if ((MatchesSearch("Directional") || MatchesSearch("Z+ (Up)")) && WeatherUtils::DrawColorEdit("Z+ (Up)", settings.dalc.directional[2].max)) changed = true; - if (MatchesSearch("Z- (Down)") && WeatherUtils::DrawColorEdit("Z- (Down)", settings.dalc.directional[2].min)) + if ((MatchesSearch("Directional") || MatchesSearch("Z- (Down)")) && WeatherUtils::DrawColorEdit("Z- (Down)", settings.dalc.directional[2].min)) changed = true; if (changed && EditorWindow::GetSingleton()->settings.autoApplyChanges) {