summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp/core
diff options
context:
space:
mode:
Diffstat (limited to 'include/godot_cpp/core')
-rw-r--r--include/godot_cpp/core/class_db.hpp3
-rw-r--r--include/godot_cpp/core/object.hpp2
-rw-r--r--include/godot_cpp/core/property_info.hpp11
3 files changed, 16 insertions, 0 deletions
diff --git a/include/godot_cpp/core/class_db.hpp b/include/godot_cpp/core/class_db.hpp
index af394f0..e5bccf3 100644
--- a/include/godot_cpp/core/class_db.hpp
+++ b/include/godot_cpp/core/class_db.hpp
@@ -165,7 +165,10 @@ public:
static void add_property(const StringName &p_class, const PropertyInfo &p_pinfo, const StringName &p_setter, const StringName &p_getter, int p_index = -1);
static void add_signal(const StringName &p_class, const MethodInfo &p_signal);
static void bind_integer_constant(const StringName &p_class_name, const StringName &p_enum_name, const StringName &p_constant_name, GDExtensionInt p_constant_value, bool p_is_bitfield = false);
+ // Binds an implementation of a virtual method defined in Godot.
static void bind_virtual_method(const StringName &p_class, const StringName &p_method, GDExtensionClassCallVirtual p_call);
+ // Add a new virtual method that can be implemented by scripts.
+ static void add_virtual_method(const StringName &p_class, const MethodInfo &p_method, const Vector<StringName> &p_arg_names = Vector<StringName>());
static MethodBind *get_method(const StringName &p_class, const StringName &p_method);
diff --git a/include/godot_cpp/core/object.hpp b/include/godot_cpp/core/object.hpp
index 79f8fbf..c1f1069 100644
--- a/include/godot_cpp/core/object.hpp
+++ b/include/godot_cpp/core/object.hpp
@@ -68,6 +68,8 @@ struct MethodInfo {
int id = 0;
std::vector<PropertyInfo> arguments;
std::vector<Variant> default_arguments;
+ GDExtensionClassMethodArgumentMetadata return_val_metadata;
+ std::vector<GDExtensionClassMethodArgumentMetadata> arguments_metadata;
inline bool operator==(const MethodInfo &p_method) const { return id == p_method.id; }
inline bool operator<(const MethodInfo &p_method) const { return id == p_method.id ? (name < p_method.name) : (id < p_method.id); }
diff --git a/include/godot_cpp/core/property_info.hpp b/include/godot_cpp/core/property_info.hpp
index 0ecfa32..f610f3f 100644
--- a/include/godot_cpp/core/property_info.hpp
+++ b/include/godot_cpp/core/property_info.hpp
@@ -80,6 +80,17 @@ struct PropertyInfo {
p_info->usage = usage;
*(reinterpret_cast<StringName *>(p_info->class_name)) = class_name;
}
+
+ GDExtensionPropertyInfo _to_gdextension() const {
+ return {
+ (GDExtensionVariantType)type,
+ name._native_ptr(),
+ class_name._native_ptr(),
+ hint,
+ hint_string._native_ptr(),
+ usage,
+ };
+ }
};
} // namespace godot