diff options
Diffstat (limited to 'editor/editor_file_dialog.cpp')
-rw-r--r-- | editor/editor_file_dialog.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 0c2faacf02..ab403c4212 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -781,12 +781,19 @@ void EditorFileDialog::update_file_list() { continue; } - if (show_hidden_files || !dir_access->current_is_hidden()) { + if (show_hidden_files) { if (!dir_access->current_is_dir()) { files.push_back(item); } else { dirs.push_back(item); } + } else if (!dir_access->current_is_hidden()) { + String full_path = cdir == "res://" ? item : dir_access->get_current_dir() + "/" + item; + if (dir_access->current_is_dir() && !EditorFileSystem::_should_skip_directory(full_path)) { + dirs.push_back(item); + } else { + files.push_back(item); + } } item = dir_access->get_next(); } @@ -1301,6 +1308,18 @@ void EditorFileDialog::_update_favorites() { favorite->set_pressed(false); Vector<String> favorited = EditorSettings::get_singleton()->get_favorites(); + + bool fav_changed = false; + for (int i = favorited.size() - 1; i >= 0; i--) { + if (!dir_access->dir_exists(favorited[i])) { + favorited.remove_at(i); + fav_changed = true; + } + } + if (fav_changed) { + EditorSettings::get_singleton()->set_favorites(favorited); + } + for (int i = 0; i < favorited.size(); i++) { bool cres = favorited[i].begins_with("res://"); if (cres != res) { |