Closed coavins closed 2 years ago
Can you give me a concrete use case/example of what exactly you're looking for out of the JSON API?
Use case 1:
I am currently providing a directory reframework/data/mhrise-coavins-dps/presets
, seeding it with a few different save files, and drawing these filenames in a dropdown box. This allows the user to easily flip through the presets until they find one they like, and they can make changes to it from there using the rest of the controls in my imgui window.
I can do the above already because I know the names of the preset files I'm including with the script, so when I draw my dropdown box, I know what to put in it.
What I want to be able to do instead is iterate this directory so that my dropdown box will just list all presets that are installed. This would allow users to design their own original preset files and share them amongst themselves without needing to update the script.
Use case 2:
I am currently allowing the user to save and load their settings using the filename save.json
in my directory reframework/data/mhrise-coavins-dps/
.
What I want to do instead is let the user specify a filename on save, and draw a dropdown box on load that lists all of the save files in the save directory (or something equivalent.) This would allow users to easily maintain multiple save files through the UI.
What I need from the API:
I think what I need is the ability to loop through filenames that are present in a given directory below the reframework/data
directory.
I second this. Would be really handy to dynamically load presets for MHW Overlay since the mod heavy relies on customization.
Ok. Thanks for the example. I'll take care of this request.
Initial support added in commit 177414d6ea454a1230ca0a2fc59b0a5aa66d7e65. Documentation for this API is at https://github.com/praydog/REFramework/wiki/fs. Let me know if this works for your requirements.
If you wish to make use of this API in your scripts, please wait until the next official REFramework release before releasing your changes.
Thank you, that looks perfect! I will post back here to let you know how it goes.
All functionality described above is currently in a working branch and I do intend to wait before merging any of it. We all eagerly await the next release!
I'm going to close this issue since I believe it has been resolved.
Hi, I'd like to allow users to supply their own customization files into a specified directory, but it seems the JSON api currently does not allow iterating filenames in a directory. As a result, I'm unable to load a file when I don't know the filename ahead of time.
Are there any plans to implement such functionality? Or am I missing how this can already be done? Thanks