summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
authorCaptainProton42 <john.wigg@gmx.net>2021-10-12 14:19:42 +0200
committerCaptainProton42 <john.wigg@gmx.net>2021-10-12 18:25:55 +0200
commita9aba86943daef698c9197bc5f827418920b409c (patch)
tree634356df5f9deeea0f0c1b23eaeea150ae586ba4 /core/object
parentb67e68bce33ff6ee79b9f36d079f81464c12a9e0 (diff)
Fetch extension class props from ClassDB
Extension class properties that have been registered with ClassDB(`GDNativeInterface::classdb_register_extension_class_property`) were not fetched previously. (Only directly providing a property list using `GDNativeExtensionClassCreationInfo::get_property_list_func` would work.) This especially caused problems with the C++ bindings since they exclusively rely on ClassDB to register properties.
Diffstat (limited to 'core/object')
-rw-r--r--core/object/object.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp
index b5797a4633..48e6799a88 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -628,7 +628,10 @@ void Object::get_property_list(List<PropertyInfo> *p_list, bool p_reversed) cons
script_instance->get_property_list(p_list);
}
- _get_property_listv(p_list, p_reversed);
+ if (_extension) {
+ p_list->push_back(PropertyInfo(Variant::NIL, _extension->class_name, PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
+ ClassDB::get_property_list(_extension->class_name, p_list, true, this);
+ }
if (_extension && _extension->get_property_list) {
uint32_t pcount;
@@ -641,6 +644,8 @@ void Object::get_property_list(List<PropertyInfo> *p_list, bool p_reversed) cons
}
}
+ _get_property_listv(p_list, p_reversed);
+
if (!is_class("Script")) { // can still be set, but this is for user-friendliness
p_list->push_back(PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script", PROPERTY_USAGE_DEFAULT));
}