diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-08-19 20:48:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-19 20:48:54 +0200 |
commit | 5b306859767d511a02618ae88a4da5fb15c9e202 (patch) | |
tree | 0b637394b2259dd36a6991f3c582ad1054f9873d /core/object/class_db.cpp | |
parent | fb8487e011fbf0310bd40cf339a58d5c60c9d259 (diff) | |
parent | 645bc94bfcb0d494e9d53e29aee1419800adcd4e (diff) |
Merge pull request #51583 from nekomatata/capsule-height-radius-setters
Fix capsule height/radius setters with linked properties
Diffstat (limited to 'core/object/class_db.cpp')
-rw-r--r-- | core/object/class_db.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index c58fe7bc24..75145e1b65 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -1068,6 +1068,20 @@ void ClassDB::set_property_default_value(const StringName &p_class, const String default_values[p_class][p_name] = p_default; } +void ClassDB::add_linked_property(const StringName &p_class, const String &p_property, const String &p_linked_property) { +#ifdef TOOLS_ENABLED + OBJTYPE_WLOCK; + ClassInfo *type = classes.getptr(p_class); + ERR_FAIL_COND(!type); + + ERR_FAIL_COND(!type->property_map.has(p_property)); + ERR_FAIL_COND(!type->property_map.has(p_linked_property)); + + PropertyInfo &pinfo = type->property_map[p_property]; + pinfo.linked_properties.push_back(p_linked_property); +#endif +} + void ClassDB::get_property_list(const StringName &p_class, List<PropertyInfo> *p_list, bool p_no_inheritance, const Object *p_validator) { OBJTYPE_RLOCK; |