aboutsummaryrefslogtreecommitdiff
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
authorvolzhs2018-02-01 10:53:31 +0900
committerHein-Pieter van Braam2018-02-04 20:09:26 +0100
commit62dc7ba82f56c3bc1bde46e01950f449cf960910 (patch)
tree93eb61d26ec0a5e0311598a7a8b946c9a5fbedde /editor/filesystem_dock.cpp
parent4a3a597377096659d1fc7d34fd022ac27d639558 (diff)
downloadgodot-62dc7ba82f56c3bc1bde46e01950f449cf960910.tar.gz
godot-62dc7ba82f56c3bc1bde46e01950f449cf960910.tar.zst
godot-62dc7ba82f56c3bc1bde46e01950f449cf960910.zip
Expand project root directory on editor start
close #16232 Option for expanding all directories on start up is a bit tricky and buggy. (cherry picked from commit 127d1241bdb8c66f574f219c466eb97da4dcbb72)
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 770eda577..8ead8d398 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -77,7 +77,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
return true;
}
-void FileSystemDock::_update_tree(bool keep_collapse_state) {
+void FileSystemDock::_update_tree(bool keep_collapse_state, bool p_uncollapse_root) {
Vector<String> uncollapsed_paths;
if (keep_collapse_state) {
@@ -129,6 +129,10 @@ void FileSystemDock::_update_tree(bool keep_collapse_state) {
ti->set_metadata(0, fave);
}
+ if (p_uncollapse_root) {
+ uncollapsed_paths.push_back("res://");
+ }
+
_create_tree(root, EditorFileSystem::get_singleton()->get_filesystem(), uncollapsed_paths);
tree->ensure_cursor_is_visible();
updating_tree = false;
@@ -204,7 +208,7 @@ void FileSystemDock::_notification(int p_what) {
if (EditorFileSystem::get_singleton()->is_scanning()) {
_set_scanning_mode();
} else {
- _update_tree(false);
+ _update_tree(false, true);
}
} break;