mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-20 21:43:50 +00:00
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 <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
|
||||
void OnMapReload() override;
|
||||
|
||||
void UpdateEnvironmentSettings();
|
||||
void UpdateEnvironmentSettings(bool sendToEngine = true);
|
||||
|
||||
protected:
|
||||
void OnFirstDisplay() override;
|
||||
|
||||
@@ -856,9 +856,6 @@ void PlayerSettingsControl::ReadFromEngine()
|
||||
++playerDefs;
|
||||
}
|
||||
|
||||
// Send default properties to engine, since they might not be set
|
||||
SendToEngine();
|
||||
|
||||
m_InGUIUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user