瀏覽代碼

Merge pull request #43948 from name-here/no-window-on-export-3.2

Don't open editor window when using --export or --doctool
Rémi Verschelde 4 年之前
父節點
當前提交
e8fb0c3230
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      main/main.cpp

+ 10 - 0
main/main.cpp

@@ -703,6 +703,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
 
 			auto_build_solutions = true;
 			editor = true;
+		} else if (I->get() == "--doctool") { // Dump the engine API reference
+
+			OS::get_singleton()->set_no_window_mode(true);
+			auto_quit = true;
 #ifdef DEBUG_METHODS_ENABLED
 		} else if (I->get() == "--gdnative-generate-json-api") {
 			// Register as an editor instance to use the GLES2 fallback automatically on hardware that doesn't support the GLES3 backend
@@ -710,11 +714,17 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
 
 			// We still pass it to the main arguments since the argument handling itself is not done in this function
 			main_args.push_back(I->get());
+
+			OS::get_singleton()->set_no_window_mode(true);
+			auto_quit = true;
 #endif
 		} else if (I->get() == "--export" || I->get() == "--export-debug" || I->get() == "--export-pack") { // Export project
 
 			editor = true;
 			main_args.push_back(I->get());
+
+			OS::get_singleton()->set_no_window_mode(true);
+			auto_quit = true;
 #endif
 		} else if (I->get() == "--path") { // set path of project to start or edit