FujiAPI / Fuji

Celeste 64 Mod Loader
30 stars 10 forks source link

In-Game Mod Settings API #48

Closed axiand closed 6 months ago

axiand commented 6 months ago

Exact implementation is yet to be defined. Basically, we would allow mods to define their own settings, which can then be changed by the player in-game. Integers, sliders, enums, etc.

The mod settings page would be auto-generated from a list of properties returned by the mod via code.

Where mod settings are changed is also yet to be defined. Could be in (a submenu of) the mod menu info page, could be in Pause > Settings > Fuji Settings > Mod Settings.

jasminegamedev commented 6 months ago

I implemented a basic version of this in https://github.com/FujiAPI/Fuji/commit/80db0c60e4e0e20fbfa7310863c5566e0c1732bb Basically, modders can set up a class that extends GameModSettings, and the game will automatically generate a Mod Options page for them based on the contents of those settings. You can also use some custom attributes to have more control over how the setting is displayed and how it works. And when you're done the setting data will get saved properly in the save file. Currently, this supports ints(sliders), bools(toggles), enums(option picker), and objects as submenus. There probably are still things that can be improved on it in future iterations, but I think this is probably good enough to call this done for now. I'll try to make a wiki page for using it tomorrow as well.