From deac8080dc9ae20c199e029a924b7e1ecc4fcce4 Mon Sep 17 00:00:00 2001 From: Hugarty Pedro Date: Tue, 7 Nov 2023 06:26:36 -0300 Subject: [PATCH] Update register_types.h and register_types.cpp in binding_to_external_libraries.rst Based in https://github.com/godotengine/godot/issues/84456 Change register_tts_types() to initialize_tts_module() Change unregister_tts_types() to uninitialize_tts_module() Add parameter ModuleInitializationLevel p_level to uninitialize_tts_module and initialize_tts_module --- .../binding_to_external_libraries.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/contributing/development/core_and_modules/binding_to_external_libraries.rst b/contributing/development/core_and_modules/binding_to_external_libraries.rst index 90570195220..a92b3a063bc 100644 --- a/contributing/development/core_and_modules/binding_to_external_libraries.rst +++ b/contributing/development/core_and_modules/binding_to_external_libraries.rst @@ -85,8 +85,8 @@ These files should contain the following: /* register_types.h */ - void register_tts_types(); - void unregister_tts_types(); + void initialize_tts_module(ModuleInitializationLevel p_level); + void uninitialize_tts_module(ModuleInitializationLevel p_level); /* yes, the word in the middle must be the same as the module folder name */ .. code-block:: cpp @@ -98,11 +98,14 @@ These files should contain the following: #include "core/object/class_db.h" #include "tts.h" - void register_tts_types() { + void initialize_tts_module(ModuleInitializationLevel p_level) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + return; + } ClassDB::register_class(); } - void unregister_tts_types() { + void uninitialize_tts_module(ModuleInitializationLevel p_level) { // Nothing to do here in this example. }