Closed z-henry closed 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.
It seems that BaseUnityPlugin.ConfigFile only provide a getter. Thanks for your answer.
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.
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)));