summaryrefslogtreecommitdiffstats
path: root/editor/editor_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_settings.cpp')
-rw-r--r--editor/editor_settings.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index ee06f08a2d..12a7c3a2ff 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1424,24 +1424,20 @@ Variant _EDITOR_GET(const String &p_setting) {
}
bool EditorSettings::_property_can_revert(const StringName &p_name) const {
- if (!props.has(p_name)) {
- return false;
- }
-
- if (!props[p_name].has_default_value) {
- return false;
+ const VariantContainer *property = props.getptr(p_name);
+ if (property) {
+ return property->has_default_value;
}
-
- return props[p_name].initial != props[p_name].variant;
+ return false;
}
bool EditorSettings::_property_get_revert(const StringName &p_name, Variant &r_property) const {
- if (!props.has(p_name) || !props[p_name].has_default_value) {
- return false;
+ const VariantContainer *value = props.getptr(p_name);
+ if (value && value->has_default_value) {
+ r_property = value->initial;
+ return true;
}
-
- r_property = props[p_name].initial;
- return true;
+ return false;
}
void EditorSettings::add_property_hint(const PropertyInfo &p_hint) {