-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameDayTimerConfig.cs
41 lines (38 loc) · 1.61 KB
/
GameDayTimerConfig.cs
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
39
40
41
namespace GameDayTimer
{
/// <summary>
/// define global (i.e. for this mod but not game specific) configuration properties
/// </summary>
/// <remarks>convention for the config file name seems to be the mod name + "Config.xml"</remarks>
[ConfigurationFileName("GameDayTimerConfig.xml")]
public class GameDayTimerConfiguration
{
// it is important to set default config values in case there is no config file
// panel properties
public bool PanelIsVisible = true;
public float PanelPositionX = GameDayTimerPanel.DefaultPanelPositionX;
public float PanelPositionY = GameDayTimerPanel.DefaultPanelPositionY;
/// <summary>
/// Save the specified panel visibility to the global config file
/// </summary>
/// <param name="isVisible"></param>
public static void SavePanelIsVisible(bool isVisible)
{
GameDayTimerConfiguration config = Configuration<GameDayTimerConfiguration>.Load();
config.PanelIsVisible = isVisible;
Configuration<GameDayTimerConfiguration>.Save();
}
/// <summary>
/// Save the specified panel position to the global config file
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
public static void SavePanelPosition(float x, float y)
{
GameDayTimerConfiguration config = Configuration<GameDayTimerConfiguration>.Load();
config.PanelPositionX = x;
config.PanelPositionY = y;
Configuration<GameDayTimerConfiguration>.Save();
}
}
}