summaryrefslogtreecommitdiff
path: root/editor/editor_autoload_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_autoload_settings.cpp')
-rw-r--r--editor/editor_autoload_settings.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index a1250ef9f4..281d614ea9 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -42,23 +42,27 @@
#define PREVIEW_LIST_MAX_SIZE 10
void EditorAutoloadSettings::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_TREE) {
- List<String> afn;
- ResourceLoader::get_recognized_extensions_for_type("Script", &afn);
- ResourceLoader::get_recognized_extensions_for_type("PackedScene", &afn);
-
- for (const String &E : afn) {
- file_dialog->add_filter("*." + E);
- }
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ List<String> afn;
+ ResourceLoader::get_recognized_extensions_for_type("Script", &afn);
+ ResourceLoader::get_recognized_extensions_for_type("PackedScene", &afn);
+
+ for (const String &E : afn) {
+ file_dialog->add_filter("*." + E);
+ }
- for (const AutoLoadInfo &info : autoload_cache) {
- if (info.node && info.in_editor) {
- get_tree()->get_root()->call_deferred(SNAME("add_child"), info.node);
+ for (const AutoLoadInfo &info : autoload_cache) {
+ if (info.node && info.in_editor) {
+ get_tree()->get_root()->call_deferred(SNAME("add_child"), info.node);
+ }
}
- }
- browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
- } else if (p_what == NOTIFICATION_THEME_CHANGED) {
- browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
+ browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
+ } break;
+
+ case NOTIFICATION_THEME_CHANGED: {
+ browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
+ } break;
}
}