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

Add a ConfigFileWatcher Class #447

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

searica
Copy link
Contributor

@searica searica commented Feb 16, 2025

Goal:
Reduce unneeded boilerplate code that is copied between mods and provide a re-usable ConfigFile FileWatcher with events for mod authors.

Details:
Adds a new extension method DisableSaveOnConfigSet() to ConfigFile to disable save on config set while returning the value prior to calling the method so it can be cached and restored later.

Adds a new ConfigFileWatcher class to create a ConfigFile FileWatcher with events on a per config file basis.

Method to reduce boilerplate code by returning the value from before disabling saving when called.
Class for creating config file watchers with a default reload delay timer and subscribe-able events
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.

1 participant