You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
[Windows, 3.x] Add support for handling network share paths.
This commit is contained in:
@@ -203,7 +203,14 @@ Vector<String> EditorFileDialog::get_selected_files() const {
|
||||
|
||||
void EditorFileDialog::update_dir() {
|
||||
if (drives->is_visible()) {
|
||||
drives->select(dir_access->get_current_drive());
|
||||
if (dir_access->get_current_dir().is_network_share_path()) {
|
||||
_update_drives(false);
|
||||
drives->add_item(RTR("Network"));
|
||||
drives->set_item_disabled(drives->get_item_count() - 1, true);
|
||||
drives->select(drives->get_item_count() - 1);
|
||||
} else {
|
||||
drives->select(dir_access->get_current_drive());
|
||||
}
|
||||
}
|
||||
dir->set_text(dir_access->get_current_dir_without_drive());
|
||||
|
||||
@@ -1125,7 +1132,7 @@ void EditorFileDialog::_select_drive(int p_idx) {
|
||||
_push_history();
|
||||
}
|
||||
|
||||
void EditorFileDialog::_update_drives() {
|
||||
void EditorFileDialog::_update_drives(bool p_select) {
|
||||
int dc = dir_access->get_drive_count();
|
||||
if (dc == 0 || access != ACCESS_FILESYSTEM) {
|
||||
drives->hide();
|
||||
@@ -1144,7 +1151,9 @@ void EditorFileDialog::_update_drives() {
|
||||
drives->add_item(dir_access->get_drive(i));
|
||||
}
|
||||
|
||||
drives->select(dir_access->get_current_drive());
|
||||
if (p_select) {
|
||||
drives->select(dir_access->get_current_drive());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user