From fe4f8b95812cd7d4d5ba67473388d8ba287e7c21 Mon Sep 17 00:00:00 2001 From: Karroffel Date: Sat, 18 Mar 2017 19:01:11 +0100 Subject: [PATCH] added support for tool scripts --- include/godot_cpp/Godot.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/godot_cpp/Godot.hpp b/include/godot_cpp/Godot.hpp index 13086c8d..0fab5ba1 100644 --- a/include/godot_cpp/Godot.hpp +++ b/include/godot_cpp/Godot.hpp @@ -54,6 +54,20 @@ void register_class() T::_register_methods(); } +template +void register_tool_class() +{ + godot_instance_create_func create = {}; + create.create_func = _godot_class_instance_func; + + godot_instance_destroy_func destroy = {}; + destroy.destroy_func = _godot_class_destroy_func; + + + godot_script_register_tool_class(T::___get_type_name(), T::___get_base_type_name(), create, destroy); + T::_register_methods(); +} +