-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ModUI.cs
71 lines (59 loc) · 2.06 KB
/
ModUI.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
using BeatSaberMarkupLanguage.Attributes;
using BeatSaberMarkupLanguage.Components;
using Chirality.Configuration;
namespace Chirality
{
class ModUI : NotifiableSingleton<ModUI>
{
public ModUI()
{
}
[UIValue("mode")]
private string Mode => ((PreferenceEnum)PluginConfig.Instance.mode).ToString();
[UIValue("enabled")]
public bool Enabled
{
get => PluginConfig.Instance.enabled;
set
{
PluginConfig.Instance.enabled = value;
}
}
[UIAction("set_enabled")]
public void SetEnabled(bool value)
{
Enabled = value;
}
/*private string Enabled => Get_Enabled();
internal string Get_Enabled()
{
if (PluginConfig.Instance.enabled)
{
return "To disable mod, set enabled in Chirality.json to false and restart game.";
}
else
return "To enable mod, set enabled in Chirality.json to true and restart game.";
}*/
public enum PreferenceEnum
{
Standard = 0,
NoArrows = 1,
OneSaber = 2,
Lawless = 3
}
// Was for in-game mode switching, but the anti-rabbit-multiplier is needed, which stops this from working immediately on maps that already have recently generated diffs
// 13 unique map selections are needed to refresh the buffer of loaded songs before the new mode can be applied to a map with previously generated diffs, so...
// May be too confusing for player. Restarting game to switch modes may be more easily understood
[UIValue("increment_value")]
private int Increment_Value
{
get => PluginConfig.Instance.mode;
set
{
PluginConfig.Instance.mode = value;
}
}
[UIAction("increment_formatter")]
private string Increment_Formatter(int value) => ((PreferenceEnum)value).ToString();
}
}