Closed bwoebi closed 3 years ago
If your settings change a lot depending on what is selected, wouldn't it be better to implement a custom class for the setting? You need to add toml converter pair and custom setting drawer for the setting. That sounds like a much more robust approach that gives you the most flexibility.
It's just hiding some settings and displaying some others instead.
Using a custom drawer would be really overkill, e.g. we have some comboboxes, which this extension just provides out of the box. The extension provides everything, except for reloading the display configuration on change of settings.
Definitely possible to roll our own thing, but - you are providing a generallly simple interface, and it covers 99% except that tiny thing about reloading settings. Using a custom drawer would essentially mean doing 95% of what the extension does myself. Seems pointless to me.
I have some settings which are only relevant when some other setting is set to a specific value.
How would I hide them? I can set Browsable = someNewValue in the
SettingChanged
handler of the ConfigEntries, but it will only take effect whenBuildSettingList()
is re-executed (e.g. on re-open, when toggling debugmode ...). I can invoke it myself via reflection as well, but this still is not satisfying because of this https://github.com/BepInEx/BepInEx.ConfigurationManager/blob/636d527f7830cf193f0c2c4c978aa814996a051d/ConfigurationManager/ConfigurationManager.cs#L160 todo item not being implemented yet.Would it be possible to have that todo item implemented and the settings rebuild ideally publicly accessible?
Alternatively an accessible callback to just rebuild a given mods settings would be also great (and probably the best solution).