| 6152 | } |
| 6153 | |
| 6154 | void EditorNode::_restart_editor(bool p_goto_project_manager) { |
| 6155 | exiting = true; |
| 6156 | |
| 6157 | if (project_run_bar->is_playing()) { |
| 6158 | project_run_bar->stop_playing(); |
| 6159 | } |
| 6160 | |
| 6161 | String to_reopen; |
| 6162 | if (!p_goto_project_manager && get_tree()->get_edited_scene_root()) { |
| 6163 | to_reopen = get_tree()->get_edited_scene_root()->get_scene_file_path(); |
| 6164 | } |
| 6165 | |
| 6166 | _exit_editor(EXIT_SUCCESS); |
| 6167 | |
| 6168 | List<String> args; |
| 6169 | for (const String &a : Main::get_forwardable_cli_arguments(Main::CLI_SCOPE_TOOL)) { |
| 6170 | args.push_back(a); |
| 6171 | } |
| 6172 | |
| 6173 | if (p_goto_project_manager) { |
| 6174 | args.push_back("--project-manager"); |
| 6175 | |
| 6176 | // Setup working directory. |
| 6177 | const String exec_dir = OS::get_singleton()->get_executable_path().get_base_dir(); |
| 6178 | if (!exec_dir.is_empty()) { |
| 6179 | args.push_back("--path"); |
| 6180 | args.push_back(exec_dir); |
| 6181 | } |
| 6182 | } else { |
| 6183 | args.push_back("--path"); |
| 6184 | args.push_back(ProjectSettings::get_singleton()->get_resource_path()); |
| 6185 | |
| 6186 | args.push_back("-e"); |
| 6187 | } |
| 6188 | |
| 6189 | if (!to_reopen.is_empty()) { |
| 6190 | args.push_back(to_reopen); |
| 6191 | } |
| 6192 | |
| 6193 | OS::get_singleton()->set_restart_on_exit(true, args); |
| 6194 | } |
| 6195 | |
| 6196 | void EditorNode::_scene_tab_closed(int p_tab) { |
| 6197 | current_menu_option = SCENE_TAB_CLOSE; |
nothing calls this directly
no test coverage detected