diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-11-20 20:09:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-20 20:09:02 +0100 |
commit | 396218179cf6754413c62f7cb952054277b25201 (patch) | |
tree | 139fe6dcbea9c94cb9a1f92522006a56942d83ca /editor | |
parent | 91a7b8c94891ccde6336e225b592675651544a79 (diff) | |
parent | e07b9a89207f3570b88d9e941bcda180db300ce6 (diff) |
Merge pull request #13102 from djrm/pr_fixes
Fixed runtime EDITOR_DEFs being dropped.
Diffstat (limited to 'editor')
-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) { |