summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index ced63815b9..37329c92f3 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -78,7 +78,6 @@
#include "editor/editor_build_profile.h"
#include "editor/editor_command_palette.h"
#include "editor/editor_data.h"
-#include "editor/editor_export.h"
#include "editor/editor_feature_profile.h"
#include "editor/editor_file_dialog.h"
#include "editor/editor_file_system.h"
@@ -91,6 +90,7 @@
#include "editor/editor_plugin.h"
#include "editor/editor_properties.h"
#include "editor/editor_property_name_processor.h"
+#include "editor/editor_quick_open.h"
#include "editor/editor_resource_picker.h"
#include "editor/editor_resource_preview.h"
#include "editor/editor_run.h"
@@ -103,7 +103,9 @@
#include "editor/editor_themes.h"
#include "editor/editor_toaster.h"
#include "editor/editor_translation_parser.h"
-#include "editor/export_template_manager.h"
+#include "editor/export/editor_export.h"
+#include "editor/export/export_template_manager.h"
+#include "editor/export/project_export.h"
#include "editor/filesystem_dock.h"
#include "editor/import/audio_stream_import_settings.h"
#include "editor/import/dynamic_font_import_settings.h"
@@ -198,9 +200,7 @@
#include "editor/plugins/visual_shader_editor_plugin.h"
#include "editor/plugins/voxel_gi_editor_plugin.h"
#include "editor/progress_dialog.h"
-#include "editor/project_export.h"
#include "editor/project_settings_editor.h"
-#include "editor/quick_open.h"
#include "editor/register_exporters.h"
#include "editor/scene_tree_dock.h"
@@ -924,6 +924,7 @@ void EditorNode::_fs_changed() {
// FIXME: Move this to a cleaner location, it's hacky to do this in _fs_changed.
String export_error;
+ Error err = OK;
if (!export_defer.preset.is_empty() && !EditorFileSystem::get_singleton()->is_scanning()) {
String preset_name = export_defer.preset;
// Ensures export_project does not loop infinitely, because notifications may
@@ -941,6 +942,7 @@ void EditorNode::_fs_changed() {
if (export_preset.is_null()) {
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
if (da->file_exists("res://export_presets.cfg")) {
+ err = FAILED;
export_error = vformat(
"Invalid export preset name: %s.\nThe following presets were detected in this project's `export_presets.cfg`:\n\n",
preset_name);
@@ -949,17 +951,19 @@ void EditorNode::_fs_changed() {
export_error += vformat(" \"%s\"\n", EditorExport::get_singleton()->get_export_preset(i)->get_name());
}
} else {
+ err = FAILED;
export_error = "This project doesn't have an `export_presets.cfg` file at its root.\nCreate an export preset from the \"Project > Export\" dialog and try again.";
}
} else {
Ref<EditorExportPlatform> platform = export_preset->get_platform();
const String export_path = export_defer.path.is_empty() ? export_preset->get_export_path() : export_defer.path;
if (export_path.is_empty()) {
+ err = FAILED;
export_error = vformat("Export preset \"%s\" doesn't have a default export path, and none was specified.", preset_name);
} else if (platform.is_null()) {
+ err = FAILED;
export_error = vformat("Export preset \"%s\" doesn't have a matching platform.", preset_name);
} else {
- Error err = OK;
if (export_defer.pack_only) { // Only export .pck or .zip data pack.
if (export_path.ends_with(".zip")) {
err = platform->export_zip(export_preset, export_defer.debug, export_path);
@@ -980,17 +984,18 @@ void EditorNode::_fs_changed() {
if (err != OK) {
export_error = vformat("Project export for preset \"%s\" failed.", preset_name);
} else if (platform->get_worst_message_type() >= EditorExportPlatform::EXPORT_MESSAGE_WARNING) {
- export_error = vformat("Project export for preset \"%s\" completed with errors.", preset_name);
+ export_error = vformat("Project export for preset \"%s\" completed with warnings.", preset_name);
}
}
}
- if (!export_error.is_empty()) {
+ if (err != OK) {
ERR_PRINT(export_error);
_exit_editor(EXIT_FAILURE);
- } else {
- _exit_editor(EXIT_SUCCESS);
+ } else if (!export_error.is_empty()) {
+ WARN_PRINT(export_error);
}
+ _exit_editor(EXIT_SUCCESS);
}
}
@@ -1795,9 +1800,16 @@ void EditorNode::restart_editor() {
_exit_editor(EXIT_SUCCESS);
List<String> args;
+
args.push_back("--path");
args.push_back(ProjectSettings::get_singleton()->get_resource_path());
+
args.push_back("-e");
+
+ if (OS::get_singleton()->is_disable_crash_handler()) {
+ args.push_back("--disable-crash-handler");
+ }
+
if (!to_reopen.is_empty()) {
args.push_back(to_reopen);
}
@@ -2176,6 +2188,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
Object *prev_inspected_object = InspectorDock::get_inspector_singleton()->get_edited_object();
bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding"));
+ bool stay_in_script_editor_on_node_selected = bool(EDITOR_GET("text_editor/behavior/navigation/stay_in_script_editor_on_node_selected"));
bool is_resource = current_obj->is_class("Resource");
bool is_node = current_obj->is_class("Node");
@@ -2214,6 +2227,9 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
NodeDock::get_singleton()->set_node(current_node);
SceneTreeDock::get_singleton()->set_selected(current_node);
InspectorDock::get_singleton()->update(current_node);
+ if (!inspector_only) {
+ inspector_only = stay_in_script_editor_on_node_selected && ScriptEditor::get_singleton()->is_visible_in_tree();
+ }
} else {
NodeDock::get_singleton()->set_node(nullptr);
SceneTreeDock::get_singleton()->set_selected(nullptr);