From 871b1d76d26ff35546fc40950aee439b6caf6366 Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Tue, 11 Aug 2020 20:20:30 +0300 Subject: Accept global classes for `MainLoop` type in project settings `application/run/main_loop_type` setting can handle custom global classes (`class_name`). For instance: `MySceneTree`. The setting's default is changed from empty to `SceneTree` as to give some hint of what kind of input is accepted for the main loop type. --- main/main.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'main') diff --git a/main/main.cpp b/main/main.cpp index 5f791159f9..65fd961f78 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1730,7 +1730,6 @@ bool Main::start() { } } - String main_loop_type; #ifdef TOOLS_ENABLED if (doc_tool != "") { Engine::get_singleton()->set_editor_hint( @@ -1825,6 +1824,7 @@ bool Main::start() { if (editor) { main_loop = memnew(SceneTree); }; + String main_loop_type = GLOBAL_DEF("application/run/main_loop_type", "SceneTree"); if (script != "") { Ref