From 628713859f1114841cc75a2f2a3145e506a9fdba Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Sat, 6 Jun 2026 09:19:57 +0200 Subject: [PATCH] Don't send default setting to engine Sending default setting on first view of a section/tool to the engine triggers the "you have changes" mechanism. Sending them just in case isn't needed unless there is a bug in a different place. Drop this preemptive measure. Fixes: #3029 Signed-off-by: Ralph Sennhauser --- .../Sections/Environment/Environment.cpp | 10 +++++++--- .../ScenarioEditor/Sections/Environment/Environment.h | 2 +- .../AtlasUI/ScenarioEditor/Sections/Player/Player.cpp | 3 --- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp index ca310a1f7c..6a5ae63e26 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp @@ -329,7 +329,7 @@ void EnvironmentSidebar::OnFirstDisplay() qry_effects.Post(); m_PostEffectList->SetChoices(*qry_effects.posteffects); - UpdateEnvironmentSettings(); + UpdateEnvironmentSettings(false); } void EnvironmentSidebar::OnMapReload() @@ -342,13 +342,17 @@ void EnvironmentSidebar::RecomputeWaterData(wxCommandEvent& WXUNUSED(evt)) POST_COMMAND(RecalculateWaterData, (0.0f)); } -void EnvironmentSidebar::UpdateEnvironmentSettings() +void EnvironmentSidebar::UpdateEnvironmentSettings(bool sendToEngine) { AtlasMessage::qGetEnvironmentSettings qry_env; qry_env.Post(); g_EnvironmentSettings = qry_env.settings; - g_EnvironmentSettings.NotifyObservers(); + if (sendToEngine) + g_EnvironmentSettings.NotifyObservers(); + else + g_EnvironmentSettings.NotifyObserversExcept(m_Conn); + } void EnvironmentSidebar::OnPickWaterHeight(wxCommandEvent& WXUNUSED(evt)) diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.h b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.h index 00b5058a04..e712c23ecb 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.h +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.h @@ -31,7 +31,7 @@ public: void OnMapReload() override; - void UpdateEnvironmentSettings(); + void UpdateEnvironmentSettings(bool sendToEngine = true); protected: void OnFirstDisplay() override; diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp index 1b8b93f4d3..f1df975c6f 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp @@ -856,9 +856,6 @@ void PlayerSettingsControl::ReadFromEngine() ++playerDefs; } - // Send default properties to engine, since they might not be set - SendToEngine(); - m_InGUIUpdate = false; }