diff options
Diffstat (limited to 'editor/editor_plugin.cpp')
-rw-r--r-- | editor/editor_plugin.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index fe44486d0d..5166200ee3 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -34,13 +34,15 @@ #include "editor/editor_export.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" +#include "editor/editor_resource_preview.h" #include "editor/editor_settings.h" #include "editor/filesystem_dock.h" +#include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" +#include "editor/plugins/script_editor_plugin.h" #include "editor/project_settings_editor.h" -#include "editor_resource_preview.h" +#include "editor/scene_tree_dock.h" #include "main/main.h" -#include "plugins/canvas_item_editor_plugin.h" -#include "plugins/node_3d_editor_plugin.h" #include "scene/3d/camera_3d.h" #include "scene/gui/popup_menu.h" #include "servers/rendering_server.h" @@ -847,11 +849,14 @@ void EditorPlugin::_editor_project_settings_changed() { emit_signal(SNAME("project_settings_changed")); } void EditorPlugin::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - EditorNode::get_singleton()->connect("project_settings_changed", callable_mp(this, &EditorPlugin::_editor_project_settings_changed)); - } - if (p_what == NOTIFICATION_EXIT_TREE) { - EditorNode::get_singleton()->disconnect("project_settings_changed", callable_mp(this, &EditorPlugin::_editor_project_settings_changed)); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { + EditorNode::get_singleton()->connect("project_settings_changed", callable_mp(this, &EditorPlugin::_editor_project_settings_changed)); + } break; + + case NOTIFICATION_EXIT_TREE: { + EditorNode::get_singleton()->disconnect("project_settings_changed", callable_mp(this, &EditorPlugin::_editor_project_settings_changed)); + } break; } } |