Provide a reliable way to see original resources in a directory

When exporting a project, resources are often moved, converted or
remapped (source import files are gone, text scenes are converted to binary,
etc).

This new function allows to list a directory and obtain the actual original
resource files.

Example

```GDScript
var resources = ResourceLoader.list_directory("res://images")
print(resources)
```
Result will be something like:
```
["image1.png","image2.png","image3.png"]
```
instead of
```
["image1.png.import","image2.png.import","image3.png.import"]
```
This commit is contained in:
Juan
2024-09-05 08:52:37 +02:00
parent db66bd35af
commit e05d5b8813
6 changed files with 73 additions and 0 deletions

View File

@@ -60,6 +60,7 @@
}
[/csharp]
[/codeblocks]
Keep in mind that file names may change or be remapped after export. If you want to see the actual resource file list as it appears in the editor, use [method ResourceLoader.list_directory] instead.
</description>
<tutorials>
<link title="File system">$DOCS_URL/tutorials/scripting/filesystem.html</link>