From 2f651277dac25ca8628102068929e3cf3e245904 Mon Sep 17 00:00:00 2001 From: reduz Date: Sat, 19 Mar 2022 13:18:52 +0100 Subject: Add static method support to ClassDB * Based on the work done for Variant in the past. * Added `ClassDB::bind_static_method` * Cleaned up ClassDB::bind_method to use variadic templates. This adds support for having static methods in Object derived classes. Note that this does not make it work yet in GDScript or Mono and, while it works for GDExtension, GodotCPP needs to be updated. --- core/extension/extension_api_dump.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/extension') diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index 31af28b783..9acc28f51e 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -666,6 +666,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() { Dictionary d2; d2["name"] = String(method_name); d2["is_const"] = (F.flags & METHOD_FLAG_CONST) ? true : false; + d2["is_static"] = (F.flags & METHOD_FLAG_STATIC) ? true : false; d2["is_vararg"] = false; d2["is_virtual"] = true; // virtual functions have no hash since no MethodBind is involved @@ -708,6 +709,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() { d2["is_const"] = method->is_const(); d2["is_vararg"] = method->is_vararg(); + d2["is_static"] = method->is_static(); d2["is_virtual"] = false; d2["hash"] = method->get_hash(); -- cgit v1.2.3