-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginConfig.cs
More file actions
150 lines (121 loc) · 5.01 KB
/
Copy pathPluginConfig.cs
File metadata and controls
150 lines (121 loc) · 5.01 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
namespace ProxyNote
{
public class PluginConfig
{
internal static PluginConfig Instance { get; set; }
public virtual int ConfigVersion { get; set; } = 0;
public virtual bool Enabled { get; set; } = true;
// Positive values start the visual jump farther away than the vanilla jump.
public virtual float JumpLeadDistance { get; set; } = 0f;
// Retained only so older configuration files remain readable.
public virtual float BombJumpLeadDistance { get; set; } = 0f;
// Retained only to migrate the pre-0.7 binary setting.
public virtual bool EnableNoteRotation { get; set; } = true;
public virtual float NoteRotationCoefficient { get; set; } = 0.2f;
public virtual bool EnableNotePositionSwaps { get; set; } = false;
public virtual bool GuideEnabled { get; set; } = true;
public virtual float GuideLength { get; set; } = 0.5f;
public virtual float GuideThickness { get; set; } = 0.05f;
public virtual float GuideOffset { get; set; } = 0.3f;
public virtual float GuideHideDistance { get; set; } = 2.5f;
public virtual bool ShowProxyOnDesktop { get; set; } = false;
public virtual bool DebugMode { get; set; } = false;
public virtual float OriginalNoteOpacity { get; set; } = 0.1f;
public virtual float ProxyNoteOpacity { get; set; } = 1.0f;
// Keep hit particles/haptics, but do not spawn the two vanilla note halves.
public virtual bool SuppressVanillaDebris { get; set; } = true;
public virtual bool UseChinese { get; set; } = false;
// Emit one overlap sample per note around the hit time. This is intentionally off by default.
public virtual bool LogCalibrationSamples { get; set; } = false;
public virtual void OnReload()
{
}
public virtual void Changed()
{
}
internal void ApplyMigrations()
{
if (ConfigVersion < 1)
{
JumpLeadDistance = 0f;
BombJumpLeadDistance = 0f;
ConfigVersion = 1;
}
if (ConfigVersion < 2)
{
EnableNoteRotation = true;
EnableNotePositionSwaps = true;
OriginalNoteOpacity = 0.1f;
ProxyNoteOpacity = 1f;
ConfigVersion = 2;
}
if (ConfigVersion < 3)
{
NoteRotationCoefficient = EnableNoteRotation ? 1f : 0f;
ConfigVersion = 3;
}
if (ConfigVersion < 4)
{
BombJumpLeadDistance = JumpLeadDistance;
ConfigVersion = 4;
}
if (ConfigVersion < 5)
{
JumpLeadDistance = JumpLeadDistance < 0f
? 0f
: JumpLeadDistance > 5f
? 5f
: JumpLeadDistance;
BombJumpLeadDistance = JumpLeadDistance;
NoteRotationCoefficient = 0.2f;
EnableNotePositionSwaps = false;
ConfigVersion = 5;
}
Changed();
}
internal void ResetToDefaults()
{
ConfigVersion = 5;
Enabled = true;
JumpLeadDistance = 0f;
BombJumpLeadDistance = 0f;
EnableNoteRotation = true;
NoteRotationCoefficient = 0.2f;
EnableNotePositionSwaps = false;
GuideEnabled = true;
GuideLength = 0.5f;
GuideThickness = 0.05f;
GuideOffset = 0.3f;
GuideHideDistance = 2.5f;
ShowProxyOnDesktop = false;
DebugMode = false;
OriginalNoteOpacity = 0.1f;
ProxyNoteOpacity = 1f;
SuppressVanillaDebris = true;
UseChinese = false;
LogCalibrationSamples = false;
}
public virtual void CopyFrom(PluginConfig other)
{
ConfigVersion = other.ConfigVersion;
Enabled = other.Enabled;
JumpLeadDistance = other.JumpLeadDistance;
BombJumpLeadDistance = other.BombJumpLeadDistance;
EnableNoteRotation = other.EnableNoteRotation;
NoteRotationCoefficient = other.NoteRotationCoefficient;
EnableNotePositionSwaps = other.EnableNotePositionSwaps;
GuideEnabled = other.GuideEnabled;
GuideLength = other.GuideLength;
GuideThickness = other.GuideThickness;
GuideOffset = other.GuideOffset;
GuideHideDistance = other.GuideHideDistance;
ShowProxyOnDesktop = other.ShowProxyOnDesktop;
DebugMode = other.DebugMode;
OriginalNoteOpacity = other.OriginalNoteOpacity;
ProxyNoteOpacity = other.ProxyNoteOpacity;
SuppressVanillaDebris = other.SuppressVanillaDebris;
UseChinese = other.UseChinese;
LogCalibrationSamples = other.LogCalibrationSamples;
}
}
}