Merge pull request #82682 from dsnopek/gdextension-dont-deprecate-script-category

GDExtension: Don't deprecate old method of getting script category
This commit is contained in:
Rémi Verschelde 2023-10-03 17:26:41 +02:00
commit dbd4c79c38
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 1 additions and 3 deletions

View File

@ -510,7 +510,7 @@ typedef struct {
GDExtensionScriptInstanceGet get_func; GDExtensionScriptInstanceGet get_func;
GDExtensionScriptInstanceGetPropertyList get_property_list_func; GDExtensionScriptInstanceGetPropertyList get_property_list_func;
GDExtensionScriptInstanceFreePropertyList free_property_list_func; GDExtensionScriptInstanceFreePropertyList free_property_list_func;
GDExtensionScriptInstanceGetClassCategory get_class_category_func; GDExtensionScriptInstanceGetClassCategory get_class_category_func; // Optional. Set to NULL for the default behavior.
GDExtensionScriptInstancePropertyCanRevert property_can_revert_func; GDExtensionScriptInstancePropertyCanRevert property_can_revert_func;
GDExtensionScriptInstancePropertyGetRevert property_get_revert_func; GDExtensionScriptInstancePropertyGetRevert property_get_revert_func;

View File

@ -676,13 +676,11 @@ public:
if (native_info->get_class_category_func(instance, &gdext_class_category)) { if (native_info->get_class_category_func(instance, &gdext_class_category)) {
p_list->push_back(PropertyInfo(gdext_class_category)); p_list->push_back(PropertyInfo(gdext_class_category));
} }
#ifndef DISABLE_DEPRECATED
} else { } else {
Ref<Script> script = get_script(); Ref<Script> script = get_script();
if (script.is_valid()) { if (script.is_valid()) {
p_list->push_back(script->get_class_category()); p_list->push_back(script->get_class_category());
} }
#endif // DISABLE_DEPRECATED
} }
} }
#endif // TOOLS_ENABLED #endif // TOOLS_ENABLED