Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom ConfigFile classes for v5lts #244

Conversation

Algorithman
Copy link

Description

Made ConfigFile class more versatile with virtual Save and Reload methods.
The type to use for the ConfigFile implementation can be added as BepInConfigType attribute to the BaseUnityPlugin class.

Motivation and Context

More and more games go online, so we had to work around issues involving server side only configuration values, but still keep them all inside one ConfigFile instance.
This not also addresses this, it also addresses others who might want to use their own file format.
The custom implementation can be done overriding SaveImplementation() and ReloadImplementation() methods.

How Has This Been Tested?

Checked it inside our Valheim plugin, our ConfigFile implementation is instanced correctly and loaded/saved also correctly.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

- changed Save() and Reload() to virtual methods
- Added Activator code to BaseUnityPlugin to use the specified type for the ConfigFile
@ghorsington
Copy link
Contributor

This is aimed at BepInEx 5. However, I'm closing this for two reasons:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants