-
Notifications
You must be signed in to change notification settings - Fork 17
/
Setting.cs
106 lines (93 loc) · 3.32 KB
/
Setting.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using Sync.Tools.ConfigurationAttribute;
using Sync.Tools;
using System;
using System.Linq;
using System.Text.RegularExpressions;
namespace OsuRTDataProvider
{
public class SettingIni : IConfigurable
{
[Integer(MinValue = 1,MaxValue = 10000)]
public ConfigurationElement ListenInterval
{
set => Setting.ListenInterval = int.Parse(value);
get => Setting.ListenInterval.ToString();
}
[Bool(RequireRestart = true)]
public ConfigurationElement EnableTourneyMode
{
get => Setting.EnableTourneyMode.ToString();
set => Setting.EnableTourneyMode = bool.Parse(value);
}
[Integer(MinValue = 1,MaxValue = 8,RequireRestart = true)]
public ConfigurationElement TeamSize {
get => Setting.TeamSize.ToString();
set
{
Setting.TeamSize = int.Parse(value);
if (Setting.TeamSize < 1 || Setting.TeamSize > 8)
{
Setting.TeamSize = 0;
Logger.Info("TeamSize must be between 1 and 8.");
}
}
}
[Bool(RequireRestart = true)]
public ConfigurationElement DebugMode
{
get => Setting.DebugMode.ToString();
set => Setting.DebugMode = bool.Parse(value);
}
[Path(IsDirectory = true, RequireRestart = true)]
public ConfigurationElement ForceOsuSongsDirectory
{
get => Setting.ForceOsuSongsDirectory;
set => Setting.ForceOsuSongsDirectory = value;
}
//Auto,Osu,Taiko,Mania,CTB
[List(ValueList = new string[] { "Auto", "Osu", "Taiko", "CatchTheBeat", "Mania" })]
public ConfigurationElement GameMode
{
get => Setting.GameMode;
set => Setting.GameMode = value;
}
[Bool]
public ConfigurationElement DisableProcessNotFoundInformation
{
set => Setting.DisableProcessNotFoundInformation = bool.Parse(value);
get => Setting.DisableProcessNotFoundInformation.ToString();
}
[Bool]
public ConfigurationElement EnableModsChangedAtListening
{
set => Setting.EnableModsChangedAtListening = bool.Parse(value);
get => Setting.EnableModsChangedAtListening.ToString();
}
public void onConfigurationLoad()
{
}
public void onConfigurationReload()
{
}
public void onConfigurationSave()
{
}
}
internal static class Setting
{
public static bool DebugMode = false;
public static int ListenInterval = 100;//ms
public static bool EnableTourneyMode = false;
public static int TeamSize = 1;
public static string ForceOsuSongsDirectory = "";
public static string GameMode = "Auto";
public static bool DisableProcessNotFoundInformation = false;
public static bool EnableModsChangedAtListening = false;
#region NoSave
public static string SongsPath = string.Empty;
public static string OsuVersion = string.Empty;
public static string Username = string.Empty;
#endregion
public static double CurrentOsuVersionValue => Utils.ConvertVersionStringToValue(OsuVersion);
}
}