Prevent crashing on startup if project has scripted theme types
Also avoid order of operation conflicts by moving C# binding generation hook to main.cpp
(cherry picked from commit 8402927d3f
)
This commit is contained in:
parent
d83245f2f9
commit
3c2e952889
|
@ -108,6 +108,10 @@
|
|||
|
||||
#include "modules/modules_enabled.gen.h" // For mono.
|
||||
|
||||
#if defined(MODULE_MONO_ENABLED) && defined(TOOLS_ENABLED)
|
||||
#include "modules/mono/editor/bindings_generator.h"
|
||||
#endif
|
||||
|
||||
/* Static members */
|
||||
|
||||
// Singletons
|
||||
|
@ -312,7 +316,6 @@ void finalize_navigation_server() {
|
|||
|
||||
void initialize_theme_db() {
|
||||
theme_db = memnew(ThemeDB);
|
||||
theme_db->initialize_theme();
|
||||
}
|
||||
|
||||
void finalize_theme_db() {
|
||||
|
@ -532,6 +535,7 @@ Error Main::test_setup() {
|
|||
|
||||
// Theme needs modules to be initialized so that sub-resources can be loaded.
|
||||
initialize_theme_db();
|
||||
theme_db->initialize_theme();
|
||||
register_scene_singletons();
|
||||
|
||||
ERR_FAIL_COND_V(TextServerManager::get_singleton()->get_interface_count() == 0, ERR_CANT_CREATE);
|
||||
|
@ -2314,6 +2318,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
|
|||
register_platform_apis();
|
||||
|
||||
// Theme needs modules to be initialized so that sub-resources can be loaded.
|
||||
// Default theme is initialized later, after ScriptServer is ready.
|
||||
initialize_theme_db();
|
||||
register_scene_singletons();
|
||||
|
||||
|
@ -2341,8 +2346,18 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
|
|||
// This loads global classes, so it must happen before custom loaders and savers are registered
|
||||
ScriptServer::init_languages();
|
||||
|
||||
theme_db->initialize_theme();
|
||||
audio_server->load_default_bus_layout();
|
||||
|
||||
#if defined(MODULE_MONO_ENABLED) && defined(TOOLS_ENABLED)
|
||||
// Hacky to have it here, but we don't have good facility yet to let modules
|
||||
// register command line options to call at the right time. This needs to happen
|
||||
// after init'ing the ScriptServer, but also after init'ing the ThemeDB,
|
||||
// for the C# docs generation in the bindings.
|
||||
List<String> cmdline_args = OS::get_singleton()->get_cmdline_args();
|
||||
BindingsGenerator::handle_cmdline_args(cmdline_args);
|
||||
#endif
|
||||
|
||||
if (use_debug_profiler && EngineDebugger::is_active()) {
|
||||
// Start the "scripts" profiler, used in local debugging.
|
||||
// We could add more, and make the CLI arg require a comma-separated list of profilers.
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
#ifdef TOOLS_ENABLED
|
||||
#include "core/os/keyboard.h"
|
||||
#include "editor/bindings_generator.h"
|
||||
#include "editor/editor_internal_calls.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_settings.h"
|
||||
|
@ -102,13 +101,6 @@ void CSharpLanguage::init() {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED)
|
||||
// Generate the bindings here, before loading assemblies. The Godot assemblies
|
||||
// may be missing if the glue wasn't generated yet in order to build them.
|
||||
List<String> cmdline_args = OS::get_singleton()->get_cmdline_args();
|
||||
BindingsGenerator::handle_cmdline_args(cmdline_args);
|
||||
#endif
|
||||
|
||||
GLOBAL_DEF("dotnet/project/assembly_name", "");
|
||||
#ifdef TOOLS_ENABLED
|
||||
GLOBAL_DEF("dotnet/project/solution_directory", "");
|
||||
|
|
Loading…
Reference in New Issue