-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPluginConfig.cs
More file actions
38 lines (34 loc) · 1.25 KB
/
PluginConfig.cs
File metadata and controls
38 lines (34 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
using System.Runtime.CompilerServices;
using IPA.Config.Stores;
[assembly: InternalsVisibleTo(GeneratedStore.AssemblyVisibilityTarget)]
namespace ExampleMod.Configuration
{
internal class PluginConfig
{
public static PluginConfig Instance { get; set; }
public virtual int IntValue { get; set; } = 42; // Must be 'virtual' if you want BSIPA to detect a value change and save the config automatically.
/// <summary>
/// This is called whenever BSIPA reads the config from disk (including when file changes are detected).
/// </summary>
public virtual void OnReload()
{
// Do stuff after config is read from disk.
}
/// <summary>
/// Call this to force BSIPA to update the config file. This is also called by BSIPA if it detects the file was modified.
/// </summary>
public virtual void Changed()
{
// Do stuff when the config is changed.
}
/// <summary>
/// Call this to have BSIPA copy the values from <paramref name="other"/> into this config.
/// </summary>
public virtual void CopyFrom(PluginConfig other)
{
// This instance's members populated from other
}
}
}
*/