Class PluginSettings
This contains all the settings for your plugin. To access a setting use GetSetting<T>(string, T?).
To use this class, inject it into the constructor of your plugin.
public class PluginSettings
- Inheritance
-
PluginSettings
Properties
Plugin
Gets the plugin these settings belong to
public Plugin Plugin { get; }
Property Value
Methods
GetSetting<T>(string, T?)
Gets the setting with the provided name. If the setting does not exist yet, it is created.
public PluginSetting<T> GetSetting<T>(string name, T? defaultValue = default)
Parameters
name
stringThe name of the setting, may not be longer than 128 characters
defaultValue
TThe default value to use if the setting does not exist yet
Returns
Type Parameters
T
The type of the setting, can be any serializable type
SaveAllSettings()
Saves all currently loaded settings
public void SaveAllSettings()