diff options
| author | Nathan Warden | 2018-02-14 10:23:04 -0500 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-02-21 21:56:37 +0100 |
| commit | 83b76a81714f8f41ec3da20df842c2acb2d63d4b (patch) | |
| tree | c007277a927c6817e02727fba1ddf40fbb9376bf /main/main.cpp | |
| parent | 70b082c0d9a554c47a5b3a8d5f01153ec3ab7222 (diff) | |
| download | godot-83b76a81714f8f41ec3da20df842c2acb2d63d4b.tar.gz godot-83b76a81714f8f41ec3da20df842c2acb2d63d4b.tar.zst godot-83b76a81714f8f41ec3da20df842c2acb2d63d4b.zip | |
Added an auto quit and auto build flag to the command line options.
(cherry picked from commit 4bfb504c2f047660ce85fda96657d5cb27415f19)
Diffstat (limited to '')
| -rw-r--r-- | main/main.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index e4c7ae242..e2d635362 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -124,6 +124,8 @@ static bool editor = false; static bool show_help = false; static bool disable_render_loop = false; static int fixed_fps = -1; +static bool auto_build_solutions = false; +static bool auto_quit = false; static OS::ProcessID allow_focus_steal_pid = 0; @@ -259,6 +261,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --export-debug Use together with --export, enables debug mode for the template.\n"); OS::get_singleton()->print(" --doctool <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found.\n"); OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n"); + OS::get_singleton()->print(" --build-solutions Builds the scripting solutions (IE. C#).\n"); #ifdef DEBUG_METHODS_ENABLED OS::get_singleton()->print(" --gdnative-generate-json-api Generate JSON dump of the Godot API for GDNative bindings.\n"); #endif @@ -520,6 +523,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "-p" || I->get() == "--project-manager") { // starts project manager project_manager = true; + } else if (I->get() == "--build-solutions") { // Build the scripting solution such C# + + auto_build_solutions = true; } else if (I->get() == "--no-window") { // disable window creation, Windows only OS::get_singleton()->set_no_window_mode(true); @@ -545,6 +551,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } } else if (I->get() == "-u" || I->get() == "--upwards") { // scan folders upwards upwards = true; + } else if (I->get() == "--quit" || I->get() == "-q") { // Auto quit at the end of the first main loop iteration + auto_quit = true; } else if (I->get().ends_with("project.godot")) { String path; String file = I->get(); @@ -1839,7 +1847,16 @@ bool Main::iteration() { target_ticks = MIN(MAX(target_ticks, current_ticks - time_step), current_ticks + time_step); } - return exit; +#ifdef TOOLS_ENABLED + if (auto_build_solutions) { + auto_build_solutions = false; + if (!EditorNode::get_singleton()->call_build()) { + ERR_FAIL_V(true); + } + } +#endif + + return exit || auto_quit; } void Main::force_redraw() { |
