Arkhist / Hacknet-Pathfinder

Hacknet Labyrinths Modloader in C#
MIT License
111 stars 18 forks source link

Extension plugins supporting user config files #167

Open Spartan322 opened 2 years ago

Spartan322 commented 2 years ago

Since as it currently stands extension plugins only natively support configs in the extensions themselves. There is a lacking purpose in doing this, as it makes the assumption the user is not responsible for the config at all.

What I propose is split extension plugin configs into two parts, extension default config, found in the extension directory, and a user plugin config, found by default in Hacknet/BepInEx/config/<ExtensionName>/<plugin guid>.cfg. Supporting this we could inherit from ConfigFile and override the behavior to load the default config then read from the user config, if the user config's entry disagrees with a default config's entry type, it will warn and resort to the default config's entry.

SoundOfScooting commented 2 years ago

I think it would be better to separate user and extension config files into two separate instances of ConfigFile, which could be implemented by adding another ConfigFile field onto HacknetPlugin. There might be options for the extension developer only that the user should not be able to override. However, this approach would prevent any overriding from occurring at all.