Don't mark settings as modified while loading

This commit is contained in:
kobewi 2024-08-17 19:23:06 +02:00
parent 1bd740d18d
commit 84e8831b89
2 changed files with 8 additions and 5 deletions

View File

@ -65,7 +65,7 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) {
_THREAD_SAFE_METHOD_ _THREAD_SAFE_METHOD_
bool changed = _set_only(p_name, p_value); bool changed = _set_only(p_name, p_value);
if (changed) { if (changed && initialized) {
changed_settings.insert(p_name); changed_settings.insert(p_name);
emit_signal(SNAME("settings_changed")); 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; return props[p_setting].has_default_value;
} }
void EditorSettings::_set_initialized() {
initialized = true;
}
void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_THREAD_SAFE_METHOD_ _THREAD_SAFE_METHOD_
// Sets up the editor setting with a default value and hint PropertyInfo. // Sets up the editor setting with a default value and hint PropertyInfo.
@ -1927,7 +1931,5 @@ EditorSettings::EditorSettings() {
last_order = 0; last_order = 0;
_load_defaults(); _load_defaults();
} callable_mp(this, &EditorSettings::_set_initialized).call_deferred();
EditorSettings::~EditorSettings() {
} }

View File

@ -98,6 +98,7 @@ private:
bool save_changed_setting = true; bool save_changed_setting = true;
bool optimize_save = true; //do not save stuff that came from config but was not set from engine 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(const StringName &p_name, const Variant &p_value);
bool _set_only(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_can_revert(const StringName &p_name) const;
bool _property_get_revert(const StringName &p_name, Variant &r_property) const; bool _property_get_revert(const StringName &p_name, Variant &r_property) const;
void _set_initialized();
void _load_defaults(Ref<ConfigFile> p_extra_config = Ref<ConfigFile>()); void _load_defaults(Ref<ConfigFile> p_extra_config = Ref<ConfigFile>());
void _load_godot2_text_editor_theme(); void _load_godot2_text_editor_theme();
void _load_default_visual_shader_editor_theme(); void _load_default_visual_shader_editor_theme();
@ -196,7 +198,6 @@ public:
#endif #endif
EditorSettings(); EditorSettings();
~EditorSettings();
}; };
//not a macro any longer //not a macro any longer