BepInEx / BepInEx.ConfigurationManager

Plugin configuration manager for BepInEx
https://www.patreon.com/ManlyMarco
GNU Lesser General Public License v3.0
227 stars 54 forks source link

Custom ConfigFile cannot be shown #53

Closed z-henry closed 1 year ago

z-henry commented 1 year ago

I create a new plugin base on BaseUnityPlugin and bind a new BepInEx.Configuration.ConfigFile which is under the floder "BepInEx\config\XXX". It seems like bind method works well, but F1 could not show any info about this plugin if (hsUnitID.Length <= 0) ConfigBind(base.Config); else ConfigBind(new BepInEx.Configuration.ConfigFile(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BepInEx/config", hsUnitID, PluginInfo.PLUGIN_GUID + ".cfg"), false, new BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)));

Windows10CE commented 1 year ago

You would have to set BaseUnityPlugin.Config, since that's what ConfigurationManager reads from, but it doesn't have a setter in C#. You could try to set the backing field instead, but as far as I know it doesn't support additional config files.

z-henry commented 1 year ago

It seems that BaseUnityPlugin.ConfigFile only provide a getter. Thanks for your answer.

ManlyMarco commented 1 year ago

Yep, if you want to have the settings show up in config manager you will have to use the default ConfigFile provided by BaseUnityPlugin. It's not planned to change this, at least not until BepInEx 6.