Class ConfigSystem
Assembly: RedLoader.dll
Syntax
public static class ConfigSystem
Fields
Categories
Declaration
public static readonly List<ConfigCategory> Categories
Field Value
Mapper
Declaration
public static readonly TomlMapper Mapper
Field Value
OnPreferencesLoaded
Occurs when a Preferences File has been loaded.
string: Path of the Preferences File.
Declaration
public static readonly MelonEvent<string> OnPreferencesLoaded
Field Value
OnPreferencesSaved
Occurs when a Preferences File has been saved.
string: Path of the Preferences File.
Declaration
public static readonly MelonEvent<string> OnPreferencesSaved
Field Value
ReflectiveCategories
Declaration
public static readonly List<ReflectiveConfigCategory> ReflectiveCategories
Field Value
Methods
CreateCategory(string)
Declaration
public static ConfigCategory CreateCategory(string identifier)
Parameters
Type |
Name |
Description |
string |
identifier |
|
Returns
CreateCategory(string, string)
Declaration
public static ConfigCategory CreateCategory(string identifier, string display_name = null)
Parameters
Returns
CreateCategory(string, string, bool, bool)
Declaration
public static ConfigCategory CreateCategory(string identifier, string display_name = null, bool is_hidden = false, bool should_save = true)
Parameters
Returns
CreateCategory<T>(string, string)
Declaration
public static ReflectiveConfigCategory CreateCategory<T>(string identifier, string display_name = null) where T : new()
Parameters
Returns
Type Parameters
CreateEntry<T>(string, string, T, string, bool)
Declaration
[Obsolete]
public static ConfigEntry CreateEntry<T>(string category_identifier, string entry_identifier, T default_value, string display_name, bool is_hidden)
Parameters
Type |
Name |
Description |
string |
category_identifier |
|
string |
entry_identifier |
|
T |
default_value |
|
string |
display_name |
|
bool |
is_hidden |
|
Returns
Type Parameters
CreateEntry<T>(string, string, T, string, string, bool, bool, ValueValidator)
Declaration
public static ConfigEntry<T> CreateEntry<T>(string category_identifier, string entry_identifier, T default_value, string display_name = null, string description = null, bool is_hidden = false, bool dont_save_default = false, ValueValidator validator = null)
Parameters
Returns
Type Parameters
CreateFileCategory(string, string, string)
Create a new category which will be saved to a custom file.
Declaration
public static ConfigCategory CreateFileCategory(string identifier, string display_name, string file_name)
Parameters
Type |
Name |
Description |
string |
identifier |
|
string |
display_name |
|
string |
file_name |
The relative filepath
|
Returns
GetCategory(string)
Declaration
public static ConfigCategory GetCategory(string identifier)
Parameters
Type |
Name |
Description |
string |
identifier |
|
Returns
GetCategory<T>(string)
Declaration
public static T GetCategory<T>(string identifier) where T : new()
Parameters
Type |
Name |
Description |
string |
identifier |
|
Returns
Type Parameters
GetEntry(string, string)
Declaration
public static ConfigEntry GetEntry(string category_identifier, string entry_identifier)
Parameters
Type |
Name |
Description |
string |
category_identifier |
|
string |
entry_identifier |
|
Returns
GetEntryValue<T>(string, string)
Declaration
public static T GetEntryValue<T>(string category_identifier, string entry_identifier)
Parameters
Type |
Name |
Description |
string |
category_identifier |
|
string |
entry_identifier |
|
Returns
Type Parameters
GetEntry<T>(string, string)
Declaration
public static ConfigEntry<T> GetEntry<T>(string category_identifier, string entry_identifier)
Parameters
Type |
Name |
Description |
string |
category_identifier |
|
string |
entry_identifier |
|
Returns
Type Parameters
GetFilePath(string)
Gets the absulute path of a Preferences File.
Declaration
public static string GetFilePath(string fileName)
Parameters
Type |
Name |
Description |
string |
fileName |
Filename relative to the userdata path
|
Returns
Type |
Description |
string |
The absolute filepath
|
HasEntry(string, string)
Declaration
public static bool HasEntry(string category_identifier, string entry_identifier)
Parameters
Type |
Name |
Description |
string |
category_identifier |
|
string |
entry_identifier |
|
Returns
Load()
Declaration
public static void Load()
RemoveCategoryFromFile(string, string)
Declaration
public static void RemoveCategoryFromFile(string filePath, string categoryName)
Parameters
Save()
Declaration
public static void Save()
SaveCategory<T>(string, bool)
Declaration
public static void SaveCategory<T>(string identifier, bool printmsg = true)
Parameters
Type |
Name |
Description |
string |
identifier |
|
bool |
printmsg |
|
Type Parameters
SetEntryValue<T>(string, string, T)
Declaration
public static void SetEntryValue<T>(string category_identifier, string entry_identifier, T value)
Parameters
Type |
Name |
Description |
string |
category_identifier |
|
string |
entry_identifier |
|
T |
value |
|
Type Parameters