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.cpp60
1 files changed, 36 insertions, 24 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 0ea8e04471..7d0601e8db 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -369,6 +369,19 @@ void EditorNode::_notification(int p_what) {
case NOTIFICATION_READY: {
+ {
+ _initializing_addons = true;
+ Vector<String> addons;
+ if (ProjectSettings::get_singleton()->has_setting("editor_plugins/enabled")) {
+ addons = ProjectSettings::get_singleton()->get("editor_plugins/enabled");
+ }
+
+ for (int i = 0; i < addons.size(); i++) {
+ set_addon_plugin_enabled(addons[i], true);
+ }
+ _initializing_addons = false;
+ }
+
VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true);
VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true);
VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);
@@ -660,12 +673,14 @@ void EditorNode::_sources_changed(bool p_exist) {
if (waiting_for_first_scan) {
waiting_for_first_scan = false;
- EditorResourcePreview::get_singleton()->start(); //start previes now that it's safe
+ // Start preview thread now that it's safe.
+ if (!singleton->cmdline_export_mode) {
+ EditorResourcePreview::get_singleton()->start();
+ }
_load_docks();
if (defer_load_scene != "") {
-
load_scene(defer_load_scene);
defer_load_scene = "";
}
@@ -1155,7 +1170,10 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
save.step(TTR("Saving Scene"), 4);
_save_scene(p_file, p_idx);
- EditorResourcePreview::get_singleton()->check_for_invalidation(p_file);
+
+ if (!singleton->cmdline_export_mode) {
+ EditorResourcePreview::get_singleton()->check_for_invalidation(p_file);
+ }
}
bool EditorNode::_validate_scene_recursive(const String &p_filename, Node *p_node) {
@@ -1747,6 +1765,8 @@ void EditorNode::_edit_current() {
return;
}
+ Object *prev_inspected_object = get_inspector()->get_edited_object();
+
bool capitalize = bool(EDITOR_GET("interface/inspector/capitalize_properties"));
bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding"));
bool is_resource = current_obj->is_class("Resource");
@@ -1838,6 +1858,11 @@ void EditorNode::_edit_current() {
inspector_dock->update(NULL);
}
+ if (current_obj == prev_inspected_object) {
+ // Make sure inspected properties are restored.
+ get_inspector()->update_tree();
+ }
+
inspector_dock->set_warning(editable_warning);
if (get_inspector()->is_capitalize_paths_enabled() != capitalize) {
@@ -2707,7 +2732,7 @@ void EditorNode::_tool_menu_option(int p_idx) {
handler->call(callback, (const Variant **)&ud, 1, ce);
if (ce.error != Variant::CallError::CALL_OK) {
String err = Variant::get_call_error_text(handler, callback, (const Variant **)&ud, 1, ce);
- ERR_PRINTS("Error calling function from tool menu: " + err);
+ ERR_PRINT("Error calling function from tool menu: " + err);
}
} // else it's a submenu so don't do anything.
} break;
@@ -3017,7 +3042,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled,
}
ps->set("editor_plugins/enabled", enabled_plugins);
ps->save();
- WARN_PRINTS("Addon '" + p_addon + "' failed to load. No directory found. Removing from enabled plugins.");
+ WARN_PRINT("Addon '" + p_addon + "' failed to load. No directory found. Removing from enabled plugins.");
return;
}
Error err = cf->load(addon_path);
@@ -3839,7 +3864,7 @@ Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_f
void EditorNode::progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
- if (singleton->disable_progress_dialog) {
+ if (singleton->cmdline_export_mode) {
print_line(p_task + ": begin: " + p_label + " steps: " + itos(p_steps));
} else {
singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel);
@@ -3848,7 +3873,7 @@ void EditorNode::progress_add_task(const String &p_task, const String &p_label,
bool EditorNode::progress_task_step(const String &p_task, const String &p_state, int p_step, bool p_force_refresh) {
- if (singleton->disable_progress_dialog) {
+ if (singleton->cmdline_export_mode) {
print_line("\t" + p_task + ": step " + itos(p_step) + ": " + p_state);
return false;
} else {
@@ -3859,7 +3884,7 @@ bool EditorNode::progress_task_step(const String &p_task, const String &p_state,
void EditorNode::progress_end_task(const String &p_task) {
- if (singleton->disable_progress_dialog) {
+ if (singleton->cmdline_export_mode) {
print_line(p_task + ": end");
} else {
singleton->progress_dialog->end_task(p_task);
@@ -3945,7 +3970,7 @@ Error EditorNode::export_preset(const String &p_preset, const String &p_path, bo
export_defer.path = p_path;
export_defer.debug = p_debug;
export_defer.pack_only = p_pack_only;
- disable_progress_dialog = true;
+ cmdline_export_mode = true;
return OK;
}
@@ -3963,7 +3988,7 @@ void EditorNode::show_warning(const String &p_text, const String &p_title) {
warning->set_title(p_title);
warning->popup_centered_minsize();
} else {
- WARN_PRINTS(p_title + " " + p_text);
+ WARN_PRINT(p_title + " " + p_text);
}
}
@@ -5587,7 +5612,7 @@ EditorNode::EditorNode() {
_initializing_addons = false;
docks_visible = true;
restoring_scenes = false;
- disable_progress_dialog = false;
+ cmdline_export_mode = false;
scene_distraction = false;
script_distraction = false;
@@ -6776,19 +6801,6 @@ EditorNode::EditorNode() {
import_dock->initialize_import_options();
- {
- _initializing_addons = true;
- Vector<String> addons;
- if (ProjectSettings::get_singleton()->has_setting("editor_plugins/enabled")) {
- addons = ProjectSettings::get_singleton()->get("editor_plugins/enabled");
- }
-
- for (int i = 0; i < addons.size(); i++) {
- set_addon_plugin_enabled(addons[i], true);
- }
- _initializing_addons = false;
- }
-
FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify);
waiting_for_first_scan = true;