diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index c3a939c0074..b9d530353c7 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -65,7 +65,7 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) { _THREAD_SAFE_METHOD_ bool changed = _set_only(p_name, p_value); - if (changed) { + if (changed && initialized) { changed_settings.insert(p_name); emit_signal(SNAME("settings_changed")); } @@ -330,6 +330,10 @@ bool EditorSettings::has_default_value(const String &p_setting) const { return props[p_setting].has_default_value; } +void EditorSettings::_set_initialized() { + initialized = true; +} + void EditorSettings::_load_defaults(Ref p_extra_config) { _THREAD_SAFE_METHOD_ // Sets up the editor setting with a default value and hint PropertyInfo. @@ -1927,7 +1931,5 @@ EditorSettings::EditorSettings() { last_order = 0; _load_defaults(); -} - -EditorSettings::~EditorSettings() { + callable_mp(this, &EditorSettings::_set_initialized).call_deferred(); } diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 62ac0c60f34..6338f9105c5 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -98,6 +98,7 @@ private: bool save_changed_setting = true; bool optimize_save = true; //do not save stuff that came from config but was not set from engine + bool initialized = false; bool _set(const StringName &p_name, const Variant &p_value); bool _set_only(const StringName &p_name, const Variant &p_value); @@ -108,6 +109,7 @@ private: bool _property_can_revert(const StringName &p_name) const; bool _property_get_revert(const StringName &p_name, Variant &r_property) const; + void _set_initialized(); void _load_defaults(Ref p_extra_config = Ref()); void _load_godot2_text_editor_theme(); void _load_default_visual_shader_editor_theme(); @@ -196,7 +198,6 @@ public: #endif EditorSettings(); - ~EditorSettings(); }; //not a macro any longer