summaryrefslogtreecommitdiffstats
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index ae7066fea9..4323025770 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -706,23 +706,7 @@ void EditorNode::_notification(int p_what) {
} break;
case NOTIFICATION_READY: {
- {
- started_timestamp = Time::get_singleton()->get_unix_time_from_system();
- _initializing_plugins = true;
- Vector<String> addons;
- if (ProjectSettings::get_singleton()->has_setting("editor_plugins/enabled")) {
- addons = GLOBAL_GET("editor_plugins/enabled");
- }
-
- for (int i = 0; i < addons.size(); i++) {
- set_addon_plugin_enabled(addons[i], true);
- }
- _initializing_plugins = false;
-
- if (!pending_addons.is_empty()) {
- EditorFileSystem::get_singleton()->connect("script_classes_updated", callable_mp(this, &EditorNode::_enable_pending_addons));
- }
- }
+ started_timestamp = Time::get_singleton()->get_unix_time_from_system();
RenderingServer::get_singleton()->viewport_set_disable_2d(get_scene_root()->get_viewport_rid(), true);
RenderingServer::get_singleton()->viewport_set_environment_mode(get_viewport()->get_viewport_rid(), RenderingServer::VIEWPORT_ENVIRONMENT_DISABLED);
@@ -860,6 +844,23 @@ void EditorNode::_update_update_spinner() {
OS::get_singleton()->set_low_processor_usage_mode(!update_continuously);
}
+void EditorNode::init_plugins() {
+ _initializing_plugins = true;
+ Vector<String> addons;
+ if (ProjectSettings::get_singleton()->has_setting("editor_plugins/enabled")) {
+ addons = GLOBAL_GET("editor_plugins/enabled");
+ }
+
+ for (const String &addon : addons) {
+ set_addon_plugin_enabled(addon, true);
+ }
+ _initializing_plugins = false;
+
+ if (!pending_addons.is_empty()) {
+ EditorFileSystem::get_singleton()->connect("script_classes_updated", callable_mp(this, &EditorNode::_enable_pending_addons), CONNECT_ONE_SHOT);
+ }
+}
+
void EditorNode::_on_plugin_ready(Object *p_script, const String &p_activate_name) {
Ref<Script> scr = Object::cast_to<Script>(p_script);
if (scr.is_null()) {
@@ -954,6 +955,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;
+ // It's important to wait for the first scan to finish; otherwise, scripts or resources might not be imported.
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