From f65672381a52323c4b375a5cd54ddb0f93ca6bb0 Mon Sep 17 00:00:00 2001 From: Jeff Brooks Date: Mon, 5 Sep 2022 22:07:57 -0500 Subject: [PATCH] Fix example Module Summator syntax. --- development/cpp/custom_modules_in_cpp.rst | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/development/cpp/custom_modules_in_cpp.rst b/development/cpp/custom_modules_in_cpp.rst index a78ef2077..1d9b16e3f 100644 --- a/development/cpp/custom_modules_in_cpp.rst +++ b/development/cpp/custom_modules_in_cpp.rst @@ -119,8 +119,10 @@ These files should contain the following: /* register_types.h */ - void register_summator_types(); - void unregister_summator_types(); + #include "modules/register_module_types.h" + + void initialize_summator_module(ModuleInitializationLevel p_level); + void uninitialize_summator_module(ModuleInitializationLevel p_level); /* yes, the word in the middle must be the same as the module folder name */ .. code-block:: cpp @@ -132,11 +134,17 @@ These files should contain the following: #include "core/object/class_db.h" #include "summator.h" - void register_summator_types() { + void initialize_summator_module(ModuleInitializationLevel p_level) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + return; + } ClassDB::register_class(); } - void unregister_summator_types() { + void uninitialize_summator_module(ModuleInitializationLevel p_level) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + return; + } // Nothing to do here in this example. }