You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Show "." in item_list of EditorFiledialog
This commit is contained in:
@@ -571,25 +571,26 @@ void EditorFileDialog::update_file_list() {
|
|||||||
files.sort_custom<NoCaseComparator>();
|
files.sort_custom<NoCaseComparator>();
|
||||||
|
|
||||||
while(!dirs.empty()) {
|
while(!dirs.empty()) {
|
||||||
|
const String& dir_name=dirs.front()->get();
|
||||||
|
|
||||||
if (dirs.front()->get()!=".") {
|
item_list->add_item(dir_name+"/");
|
||||||
item_list->add_item(dirs.front()->get()+"/");
|
|
||||||
if (display_mode==DISPLAY_THUMBNAILS) {
|
|
||||||
|
|
||||||
item_list->set_item_icon(item_list->get_item_count()-1,folder_thumbnail);
|
if (display_mode==DISPLAY_THUMBNAILS) {
|
||||||
} else {
|
|
||||||
|
|
||||||
item_list->set_item_icon(item_list->get_item_count()-1,folder);
|
item_list->set_item_icon(item_list->get_item_count()-1,folder_thumbnail);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
Dictionary d;
|
item_list->set_item_icon(item_list->get_item_count()-1,folder);
|
||||||
d["name"]=dirs.front()->get();
|
|
||||||
d["path"]=String();
|
|
||||||
d["dir"]=true;
|
|
||||||
item_list->set_item_metadata( item_list->get_item_count() -1, d);
|
|
||||||
}
|
}
|
||||||
dirs.pop_front();
|
|
||||||
|
|
||||||
|
Dictionary d;
|
||||||
|
d["name"]=dir_name;
|
||||||
|
d["path"]=String();
|
||||||
|
d["dir"]=true;
|
||||||
|
|
||||||
|
item_list->set_item_metadata( item_list->get_item_count() -1, d);
|
||||||
|
|
||||||
|
dirs.pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
dirs.clear();
|
dirs.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user