| 55 | } |
| 56 | |
| 57 | Error EditorRun::run(const String &p_scene, const String &p_write_movie, const Vector<String> &p_run_args) { |
| 58 | List<String> args; |
| 59 | |
| 60 | for (const String &a : Main::get_forwardable_cli_arguments(Main::CLI_SCOPE_PROJECT)) { |
| 61 | args.push_back(a); |
| 62 | } |
| 63 | |
| 64 | String resource_path = ProjectSettings::get_singleton()->get_resource_path(); |
| 65 | if (!resource_path.is_empty()) { |
| 66 | args.push_back("--path"); |
| 67 | args.push_back(resource_path.replace(" ", "%20")); |
| 68 | } |
| 69 | |
| 70 | const String debug_uri = EditorDebuggerNode::get_singleton()->get_server_uri(); |
| 71 | if (debug_uri.size()) { |
| 72 | args.push_back("--remote-debug"); |
| 73 | args.push_back(debug_uri); |
| 74 | } |
| 75 | |
| 76 | args.push_back("--editor-pid"); |
| 77 | args.push_back(itos(OS::get_singleton()->get_process_id())); |
| 78 | |
| 79 | bool debug_collisions = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_collisions", false); |
| 80 | bool debug_paths = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_paths", false); |
| 81 | bool debug_navigation = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_navigation", false); |
| 82 | bool debug_avoidance = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_avoidance", false); |
| 83 | bool debug_canvas_redraw = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_canvas_redraw", false); |
| 84 | bool debug_mute_audio = EditorDebuggerNode::get_singleton()->get_debug_mute_audio(); |
| 85 | |
| 86 | if (debug_collisions) { |
| 87 | args.push_back("--debug-collisions"); |
| 88 | } |
| 89 | |
| 90 | if (debug_paths) { |
| 91 | args.push_back("--debug-paths"); |
| 92 | } |
| 93 | |
| 94 | if (debug_navigation) { |
| 95 | args.push_back("--debug-navigation"); |
| 96 | } |
| 97 | |
| 98 | if (debug_avoidance) { |
| 99 | args.push_back("--debug-avoidance"); |
| 100 | } |
| 101 | |
| 102 | if (debug_canvas_redraw) { |
| 103 | args.push_back("--debug-canvas-item-redraw"); |
| 104 | } |
| 105 | |
| 106 | if (debug_mute_audio) { |
| 107 | args.push_back("--debug-mute-audio"); |
| 108 | } |
| 109 | |
| 110 | if (p_write_movie != "") { |
| 111 | args.push_back("--write-movie"); |
| 112 | args.push_back(p_write_movie); |
| 113 | args.push_back("--fixed-fps"); |
| 114 | args.push_back(itos(GLOBAL_GET("editor/movie_writer/fps"))); |