summaryrefslogtreecommitdiff
path: root/scene/gui/file_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/file_dialog.cpp')
-rw-r--r--scene/gui/file_dialog.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index fbcfdb69bb..47f862a58d 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -29,6 +29,8 @@
#include "file_dialog.h"
#include "scene/gui/label.h"
#include "print_string.h"
+#include "os/keyboard.h"
+#include "tools/editor/editor_settings.h"
FileDialog::GetIconFunc FileDialog::get_icon_func=NULL;
@@ -278,13 +280,20 @@ void FileDialog::update_file_list() {
List<String> dirs;
bool isdir;
+ bool ishidden;
+ bool show_hidden = EditorSettings::get_singleton()->get("file_dialog/show_hidden_files");
String item;
+
while ((item=dir_access->get_next(&isdir))!="") {
-
- if (!isdir)
- files.push_back(item);
- else
- dirs.push_back(item);
+
+ ishidden = dir_access->current_is_hidden();
+
+ if (show_hidden || !ishidden) {
+ if (!isdir)
+ files.push_back(item);
+ else
+ dirs.push_back(item);
+ }
}
dirs.sort_custom<NoCaseComparator>();