@@ -110,7 +110,7 @@ class ClassDB {
110110static  void  bind_method_godot (const  StringName &p_class_name, MethodBind *p_method);
111111
112112template  <class  T , bool  is_abstract>
113- static  void  _register_class (bool  p_virtual = false , bool  p_exposed = true );
113+ static  void  _register_class (bool  p_virtual = false , bool  p_exposed = true ,  bool  p_tool =  true );
114114
115115public: 
116116template  <class  T >
@@ -120,6 +120,8 @@ class ClassDB {
120120template  <class  T >
121121static  void  register_internal_class ();
122122template  <class  T >
123+ static  void  register_gameplay_class ();
124+ template  <class  T >
123125static  void  register_engine_class ();
124126
125127template  <class  N , class  M , typename ... VarArgs>
@@ -167,7 +169,7 @@ class ClassDB {
167169}
168170
169171template  <class  T , bool  is_abstract>
170- void  ClassDB::_register_class (bool  p_virtual, bool  p_exposed) {
172+ void  ClassDB::_register_class (bool  p_virtual, bool  p_exposed,  bool  p_tool ) {
171173instance_binding_callbacks[T::get_class_static ()] = &T::_gde_binding_callbacks;
172174
173175//  Register this class within our plugin
@@ -184,10 +186,11 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed) {
184186class_register_order.push_back (cl.name );
185187
186188//  Register this class with Godot
187- GDExtensionClassCreationInfo2  class_info = {
189+ GDExtensionClassCreationInfo3  class_info = {
188190p_virtual, //  GDExtensionBool is_virtual;
189191is_abstract, //  GDExtensionBool is_abstract;
190192p_exposed, //  GDExtensionBool is_exposed;
193+ p_tool, //  GDExtensionBool is_tool;
191194T::set_bind, //  GDExtensionClassSet set_func;
192195T::get_bind, //  GDExtensionClassGet get_func;
193196T::has_get_property_list () ? T::get_property_list_bind : nullptr , //  GDExtensionClassGetPropertyList get_property_list_func;
@@ -209,7 +212,7 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed) {
209212(void  *)&T::get_class_static (), //  void *class_userdata;
210213};
211214
212- internal::gdextension_interface_classdb_register_extension_class2  (internal::library, cl.name ._native_ptr (), cl.parent_name ._native_ptr (), &class_info);
215+ internal::gdextension_interface_classdb_register_extension_class3  (internal::library, cl.name ._native_ptr (), cl.parent_name ._native_ptr (), &class_info);
213216
214217//  call bind_methods etc. to register all members of the class
215218T::initialize_class ();
@@ -233,6 +236,11 @@ void ClassDB::register_internal_class() {
233236ClassDB::_register_class<T, false >(false , false );
234237}
235238
239+ template  <class  T >
240+ void  ClassDB::register_gameplay_class () {
241+ ClassDB::_register_class<T, false >(false , true , false );
242+ }
243+ 
236244template  <class  T >
237245void  ClassDB::register_engine_class () {
238246instance_binding_callbacks[T::get_class_static ()] = &T::_gde_binding_callbacks;
@@ -297,6 +305,7 @@ MethodBind *ClassDB::bind_vararg_method(uint32_t p_flags, StringName p_name, M p
297305#define  GDREGISTER_VIRTUAL_CLASS (m_class ) ClassDB::register_class<m_class>(true );
298306#define  GDREGISTER_ABSTRACT_CLASS (m_class ) ClassDB::register_abstract_class<m_class>();
299307#define  GDREGISTER_INTERNAL_CLASS (m_class ) ClassDB::register_internal_class<m_class>();
308+ #define  GDREGISTER_GAMEPLAY_CLASS (m_class ) ClassDB::register_gameplay_class<m_class>();
300309
301310} //  namespace godot
302311
0 commit comments