summaryrefslogtreecommitdiffstats
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2024-07-28 20:31:36 +0200
committerkobewi <kobewi4e@gmail.com>2024-07-28 20:31:36 +0200
commit2470eedd614c7a902c8ff0d6d013da014f4267bb (patch)
tree6b2691d2ae23693e7bbfda5c032111c9b4f61127 /editor/editor_node.cpp
parent88d9325065a3e00e9e168ffad4ff93e12455a357 (diff)
downloadredot-engine-2470eedd614c7a902c8ff0d6d013da014f4267bb.tar.gz
Call restart_editor() in RUN_PROJECT_MANAGER
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp33
1 files changed, 10 insertions, 23 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 8b6d316dd1..7a9a265ffc 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1961,7 +1961,7 @@ void EditorNode::try_autosave() {
editor_data.save_editor_external_data();
}
-void EditorNode::restart_editor() {
+void EditorNode::restart_editor(bool p_goto_project_manager) {
exiting = true;
if (project_run_bar->is_playing()) {
@@ -1969,22 +1969,25 @@ void EditorNode::restart_editor() {
}
String to_reopen;
- if (get_tree()->get_edited_scene_root()) {
+ if (!p_goto_project_manager && get_tree()->get_edited_scene_root()) {
to_reopen = get_tree()->get_edited_scene_root()->get_scene_file_path();
}
_exit_editor(EXIT_SUCCESS);
List<String> args;
-
for (const String &a : Main::get_forwardable_cli_arguments(Main::CLI_SCOPE_TOOL)) {
args.push_back(a);
}
- args.push_back("--path");
- args.push_back(ProjectSettings::get_singleton()->get_resource_path());
+ if (p_goto_project_manager) {
+ args.push_back("--project-manager");
+ } else {
+ args.push_back("--path");
+ args.push_back(ProjectSettings::get_singleton()->get_resource_path());
- args.push_back("-e");
+ args.push_back("-e");
+ }
if (!to_reopen.is_empty()) {
args.push_back(to_reopen);
@@ -3391,23 +3394,7 @@ void EditorNode::_discard_changes(const String &p_str) {
} break;
case RUN_PROJECT_MANAGER: {
- project_run_bar->stop_playing();
- _exit_editor(EXIT_SUCCESS);
- String exec = OS::get_singleton()->get_executable_path();
-
- List<String> args;
- for (const String &a : Main::get_forwardable_cli_arguments(Main::CLI_SCOPE_TOOL)) {
- args.push_back(a);
- }
-
- String exec_base_dir = exec.get_base_dir();
- if (!exec_base_dir.is_empty()) {
- args.push_back("--path");
- args.push_back(exec_base_dir);
- }
- args.push_back("--project-manager");
-
- OS::get_singleton()->set_restart_on_exit(true, args);
+ restart_editor(true);
} break;
case RELOAD_CURRENT_PROJECT: {
restart_editor();