Unly call module editor initialization level when the editor hint is set.

This commit is contained in:
Relintai 2023-01-15 17:09:46 +01:00
parent 227e32b67c
commit b1362141e2

View File

@ -1528,7 +1528,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_PLATFORM);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SERVER);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SCENE);
if (Engine::get_singleton()->is_editor_hint()) {
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_EDITOR);
}
//register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_TEST);
register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_FINALIZE);
@ -2453,7 +2455,9 @@ void Main::cleanup(bool p_force) {
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_START);
//unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_TEST);
if (Engine::get_singleton()->is_editor_hint()) {
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_EDITOR);
}
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SCENE);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SERVER);
unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_PLATFORM);