diff options
| author | Rémi Verschelde | 2017-08-19 16:45:03 +0200 |
|---|---|---|
| committer | Rémi Verschelde | 2017-08-19 16:48:11 +0200 |
| commit | 70b0857f6c099339214d0ec2667990e9b7c3c5ea (patch) | |
| tree | 62a5e5ef873d6eaf53667bd652dccbcace5cfe03 /editor/editor_run.cpp | |
| parent | 27fc96f3c8528f0f9cc6e42d8e64934ba1b48d6d (diff) | |
| download | godot-70b0857f6c099339214d0ec2667990e9b7c3c5ea.tar.gz godot-70b0857f6c099339214d0ec2667990e9b7c3c5ea.tar.zst godot-70b0857f6c099339214d0ec2667990e9b7c3c5ea.zip | |
Fixes for new two-dash long command line arguments
- Fixes some single-dash leftovers that were missed in the previous commit
- Reorder the help output for clarity, and document missing options
- Drop obsolete options: --noop, --pack, --editor-scene, --level, --import, --import-script, --no-quit
- Improve error message on malformed arguments and do not display help on error
- Cleanup obsolete code here and there
Diffstat (limited to 'editor/editor_run.cpp')
| -rw-r--r-- | editor/editor_run.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index 5130d8b7d..28907ccf5 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -58,7 +58,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li args.push_back(String::num(OS::get_singleton()->get_process_id())); if (debug_collisions) { - args.push_back("--debug-collision"); + args.push_back("--debug-collisions"); } if (debug_navigation) { @@ -66,7 +66,6 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li } int screen = EditorSettings::get_singleton()->get("run/window_placement/screen"); - if (screen == 0) { screen = OS::get_singleton()->get_current_screen(); } else { @@ -78,7 +77,6 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li screen_rect.size = OS::get_singleton()->get_screen_size(screen); Size2 desired_size; - desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/width"); desired_size.y = ProjectSettings::get_singleton()->get("display/window/size/height"); @@ -95,39 +93,39 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li switch (window_placement) { case 0: { // default - args.push_back("-p"); + args.push_back("--position"); args.push_back(itos(screen_rect.position.x) + "x" + itos(screen_rect.position.y)); } break; case 1: { // centered Vector2 pos = screen_rect.position + ((screen_rect.size - desired_size) / 2).floor(); - args.push_back("-p"); + args.push_back("--position"); args.push_back(itos(pos.x) + "," + itos(pos.y)); } break; case 2: { // custom pos Vector2 pos = EditorSettings::get_singleton()->get("run/window_placement/rect_custom_position"); pos += screen_rect.position; - args.push_back("-p"); + args.push_back("--position"); args.push_back(itos(pos.x) + "," + itos(pos.y)); } break; case 3: { // force maximized Vector2 pos = screen_rect.position; - args.push_back("-p"); + args.push_back("--position"); args.push_back(itos(pos.x) + "," + itos(pos.y)); - args.push_back("-m"); + args.push_back("--maximized"); } break; case 4: { // force fullscreen Vector2 pos = screen_rect.position; - args.push_back("-p"); + args.push_back("--position"); args.push_back(itos(pos.x) + "," + itos(pos.y)); - args.push_back("-f"); + args.push_back("--fullscreen"); } break; } if (p_breakpoints.size()) { - args.push_back("-b"); + args.push_back("--breakpoints"); String bpoints; for (const List<String>::Element *E = p_breakpoints.front(); E; E = E->next()) { @@ -152,7 +150,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li String exec = OS::get_singleton()->get_executable_path(); - printf("running: %ls", exec.c_str()); + printf("Running: %ls", exec.c_str()); for (List<String>::Element *E = args.front(); E; E = E->next()) { printf(" %ls", E->get().c_str()); |
