summaryrefslogtreecommitdiffstats
path: root/core/object/script_language_extension.h
diff options
context:
space:
mode:
authorDavid Cambré <david.cambre@gmail.com>2023-07-01 15:09:21 +0200
committerDavid Cambré <david.cambre@gmail.com>2023-09-27 17:45:48 +0200
commit531f56e8307c5e9691a6db2f589025af28d200ea (patch)
tree01646537b6e18b441f26ebf7820c04757ce1c6d7 /core/object/script_language_extension.h
parentb905959f4382020b424fa093c380e163a7a7f404 (diff)
downloadredot-engine-531f56e8307c5e9691a6db2f589025af28d200ea.tar.gz
add GDExtensionScriptInstanceGetClassCategory
Change GetClassCategory so it is handled in native directly
Diffstat (limited to 'core/object/script_language_extension.h')
-rw-r--r--core/object/script_language_extension.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h
index 3e8284670c..b682efec12 100644
--- a/core/object/script_language_extension.h
+++ b/core/object/script_language_extension.h
@@ -670,9 +670,20 @@ public:
const GDExtensionPropertyInfo *pinfo = native_info->get_property_list_func(instance, &pcount);
#ifdef TOOLS_ENABLED
- Ref<Script> script = get_script();
- if (script.is_valid() && pcount > 0) {
- p_list->push_back(script->get_class_category());
+ if (pcount > 0) {
+ if (native_info->get_class_category_func) {
+ GDExtensionPropertyInfo gdext_class_category;
+ if (native_info->get_class_category_func(instance, &gdext_class_category)) {
+ p_list->push_back(PropertyInfo(gdext_class_category));
+ }
+#ifndef DISABLE_DEPRECATED
+ } else {
+ Ref<Script> script = get_script();
+ if (script.is_valid()) {
+ p_list->push_back(script->get_class_category());
+ }
+#endif // DISABLE_DEPRECATED
+ }
}
#endif // TOOLS_ENABLED