WIP: Add list used files command
old commit by @slipher initially wrote for kharnov's purpose, was intensively used to clean-up the game packs from dust for 0.51 release. This is also very convenient to check if a file is loaded as expected, like for troubleshooting #159.
Note that some files are loaded dynamically, so be sure to have spawned any character model / weapon and have walked any possible menu to be sure every used file is listed.
I modified the patch a bit to make it working on the now-extracted engine directory, reverted to lowercase override and did some camelCase, whitespace and blank line bikeshedding.
I don't know why this was never merged before, is there any issue with it?
I feel like some combination of "which" and autocomplete somehow already does this.
This is not the only interface for opening a pak file, for example there is also FS::PakPath::ReadFile. So it's not exactly correct.
To be sure we talk about the same thing: the purpose of this is to only list what's loaded because of it being used, not to list what's available.
can we merge this?
This only handles stuff from the legacy code paths I think?
https://github.com/DaemonEngine/Daemon/blob/3a29a12342f80bd6056e1caa5a002e4d09d42271/src/common/FileSystem.cpp#L710
I don't know what you are talking about 🤔
note that we can rename the listFiles command as listLoadedFiles since the purpose of the PR is to provide a way to list files that are loaded because needed (and no more), not to list all files available (that would be another command).
I just renamed from listFiles to listUsedFiles since it basically prints the usedFiles list, and used makes more sense than loaded in this context.
It only counts files that were opened with FS_FOpenFileRead. The engine has other file APIs that don't go through this function, so the results are incomplete (therefore it should not be merged).
Ah ok now I understand.