summaryrefslogtreecommitdiffstats
path: root/core/object/object.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-05-07 22:12:22 +0200
committerkobewi <kobewi4e@gmail.com>2023-05-07 22:12:22 +0200
commit5e3a985c91e95a85a883cbcfab7c147cb0075770 (patch)
treedd03ad7593f2eaf7f770c7d2b17b70e5e7ea1cb0 /core/object/object.cpp
parent64eeb04d2cb2e269d9710c38bdbf366ab3656e76 (diff)
downloadredot-engine-5e3a985c91e95a85a883cbcfab7c147cb0075770.tar.gz
Don't refresh inspector when changing internal meta
Diffstat (limited to 'core/object/object.cpp')
-rw-r--r--core/object/object.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp
index d96f4eb9fc..f6ab2108d1 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -884,8 +884,13 @@ void Object::set_meta(const StringName &p_name, const Variant &p_value) {
if (p_value.get_type() == Variant::NIL) {
if (metadata.has(p_name)) {
metadata.erase(p_name);
- metadata_properties.erase("metadata/" + p_name.operator String());
- notify_property_list_changed();
+
+ const String &sname = p_name;
+ metadata_properties.erase("metadata/" + sname);
+ if (!sname.begins_with("_")) {
+ // Metadata starting with _ don't show up in the inspector, so no need to update.
+ notify_property_list_changed();
+ }
}
return;
}
@@ -896,8 +901,12 @@ void Object::set_meta(const StringName &p_name, const Variant &p_value) {
} else {
ERR_FAIL_COND(!p_name.operator String().is_valid_identifier());
Variant *V = &metadata.insert(p_name, p_value)->value;
- metadata_properties["metadata/" + p_name.operator String()] = V;
- notify_property_list_changed();
+
+ const String &sname = p_name;
+ metadata_properties["metadata/" + sname] = V;
+ if (!sname.begins_with("_")) {
+ notify_property_list_changed();
+ }
}
}