You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fix duplicated folder reference in Godot Editor after changing filename case
(cherry picked from commit 87b5a56ddf)
This commit is contained in:
@@ -1350,6 +1350,10 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
|
|||||||
|
|
||||||
String f = ProjectSettings::get_singleton()->localize_path(p_file);
|
String f = ProjectSettings::get_singleton()->localize_path(p_file);
|
||||||
|
|
||||||
|
// Note: Only checks if base directory is case sensitive.
|
||||||
|
Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
||||||
|
bool fs_case_sensitive = dir->is_case_sensitive("res://");
|
||||||
|
|
||||||
if (!f.begins_with("res://")) {
|
if (!f.begins_with("res://")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1373,10 +1377,17 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
|
|||||||
|
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
for (int j = 0; j < fs->get_subdir_count(); j++) {
|
for (int j = 0; j < fs->get_subdir_count(); j++) {
|
||||||
|
if (fs_case_sensitive) {
|
||||||
if (fs->get_subdir(j)->get_name() == path[i]) {
|
if (fs->get_subdir(j)->get_name() == path[i]) {
|
||||||
idx = j;
|
idx = j;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (fs->get_subdir(j)->get_name().to_lower() == path[i].to_lower()) {
|
||||||
|
idx = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx == -1) {
|
if (idx == -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user