-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.cs
38 lines (29 loc) · 955 Bytes
/
Settings.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
using System.IO;
using static In_Game_Chat.Serializer;
namespace In_Game_Chat
{
internal class Settings
{
private static Settings settings;
public static Settings LoadedSettings
{
get { return (settings != null) ? settings : LoadSettings(); }
set { settings = value; }
}
public static string settingsPath = MelonMain.modDir + "//settings.json";
// Put the properties you want to save in here
#region Properties
#endregion
public static Settings LoadSettings()
{
settings = (File.Exists(settingsPath)) ? LoadFromFile<Settings>(settingsPath) : CreateNewSettingsFile();
return settings;
}
private static Settings CreateNewSettingsFile()
{
var settings = new Settings();
SaveToFile<Settings>(settings, settingsPath);
return settings;
}
}
}