diff options
-rw-r--r-- | editor/editor_settings.cpp | 12 | ||||
-rw-r--r-- | editor/editor_settings.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index d228dd2581..fef5f08ee9 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -135,7 +135,7 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const { void EditorSettings::_initial_set(const StringName &p_name, const Variant &p_value) { set(p_name, p_value); props[p_name].initial = p_value; - props[p_name].initial_set = true; + props[p_name].has_default_value = true; } struct _EVCSort { @@ -221,7 +221,7 @@ bool EditorSettings::has_default_value(const String &p_setting) const { if (!props.has(p_setting)) return false; - return props[p_setting].initial_set; + return props[p_setting].has_default_value; } void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { @@ -967,7 +967,7 @@ void EditorSettings::set_initial_value(const StringName &p_setting, const Varian if (!props.has(p_setting)) return; props[p_setting].initial = p_value; - props[p_setting].initial_set = true; + props[p_setting].has_default_value = true; } Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default) { @@ -975,10 +975,10 @@ Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default) { Variant ret = p_default; if (EditorSettings::get_singleton()->has_setting(p_setting)) ret = EditorSettings::get_singleton()->get(p_setting); - if (!EditorSettings::get_singleton()->has_default_value(p_setting)) { - EditorSettings::get_singleton()->set_initial_value(p_setting, p_default); + else EditorSettings::get_singleton()->set(p_setting, p_default); - } + if (!EditorSettings::get_singleton()->has_default_value(p_setting)) + EditorSettings::get_singleton()->set_initial_value(p_setting, p_default); return ret; } diff --git a/editor/editor_settings.h b/editor/editor_settings.h index f11f4dfd43..a8c991a6d9 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -66,13 +66,13 @@ private: int order; Variant variant; Variant initial; - bool initial_set; + bool has_default_value; bool hide_from_editor; bool save; VariantContainer() { order = 0; hide_from_editor = false; - initial_set = false; + has_default_value = false; save = false; } VariantContainer(const Variant &p_variant, int p_order) { |