Skip to content

Conversation

@Xenius97
Copy link
Contributor

@Xenius97 Xenius97 commented Nov 16, 2025

Closes #4543

This PR makes possible to list files within a given resource along with specific filtering conditions.

Usage:

getResourceFiles(resource theResource [, bool includeAttributes = false, string filter = "all/map/script/config/file" ]])
iprint(getResourceFiles())
iprint(getResourceFiles(getResourceFromName("cam2rt"), false, "script"))

Important

The client-side function will only be able to see the files that are actually sent to the client.

@Fernando-A-Rocha
Copy link
Contributor

Fernando-A-Rocha commented Nov 16, 2025

Thank you!
I will use this function for my "new models" resource:

  • in meta.xml I have file globs like models/*.dff
  • I will use getResourceFiles to find all file paths starting with "models/"
  • i will be able to determine if they have the download="false" attribute,
  • then perform some logic to store the new models info in a table
  • and send the list to clients so they can do downloadFile or access the file directly to load the mod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add getResourceFiles function

3 participants