From a5d8af46bb02605121e2d482608004ddf5e1c67c Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 8 Jan 2023 15:56:00 +0100 Subject: [PATCH] Updated register_types.h and cpp to the current godot 4 style. --- register_types.cpp | 14 +++++++++----- register_types.h | 11 +++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/register_types.cpp b/register_types.cpp index fc4149d..7c005cb 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -22,15 +22,19 @@ SOFTWARE. #include "register_types.h" +#include "core/object/class_db.h" + #include "bs_input_event_key.h" #include "input_map_editor.h" #include "touch_button.h" -void register_ui_extensions_types() { - ClassDB::register_class(); - ClassDB::register_class(); - ClassDB::register_class(); +void initialize_ui_extensions_module(ModuleInitializationLevel p_level) { + if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) { + GDREGISTER_CLASS(TouchButton); + GDREGISTER_CLASS(BSInputEventKey); + GDREGISTER_CLASS(InputMapEditor); + } } -void unregister_ui_extensions_types() { +void uninitialize_ui_extensions_module(ModuleInitializationLevel p_level) { } diff --git a/register_types.h b/register_types.h index b349c63..43603ff 100644 --- a/register_types.h +++ b/register_types.h @@ -20,5 +20,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_ui_extensions_types(); -void unregister_ui_extensions_types(); +#ifndef UI_EXTENSIONS_REGISTER_TYPES_H +#define UI_EXTENSIONS_REGISTER_TYPES_H + +#include "modules/register_module_types.h" + +void initialize_ui_extensions_module(ModuleInitializationLevel p_level); +void uninitialize_ui_extensions_module(ModuleInitializationLevel p_level); + +#endif