Local Settings
What did i add?
A local settings implementation that allows users to bind BepInEx config entries to settings.
How does it work?
First you need to create a ModSettingsTab. The best way would be to create a variable for it in the plugin class
It supports multiple tabs from one plugin
ModSettingsTab modTab = LocalSettingsManager.CreateSettingsTab(plugin);
Then you can bind config entries with:
modTab.BindEntry(YourConfigEntry);
BindEntry() method automatically binds any supported type of entry. You can bind bool, int, float and enum entries.
By default, it grabs the name and description from the entry itself, but you can set a different one with the arguments.
To modify things specific to one type, use the corresponding to type bind method:
modTab.BindBoolEntry(BoolConfigEntry, onColor: Color.green, offColor: Color.red) // a bool one
modTab.BindEnumEntry( // an enum one
ExampleEnumEntry,
enumType: typeof(ExampleSettingEnum),
customNames: ["Cheeseburger", "Fries", "Pizza", "Chicken Nuggets"]
);
Things that might break
The amount of settings you can add is limited because after binding lots of setting they go out of the screen, so the tab would need a scroller. This issue also exists in the tabs but you would need like 10 different mods, each one having their tabs for it to fill out so i don't think it would be an issue. From what i've tested, everything else seems to be fine
xtra's readme changes also got added here for some reason lol
Don't know how I feel about using config binds for everything. Might be better and more consistent to use an approach similar to options.
btw im working on revamping this