-
Notifications
You must be signed in to change notification settings - Fork 1
/
Configuration.cs
105 lines (92 loc) · 3.67 KB
/
Configuration.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
using Dalamud.Configuration;
namespace Heliosphere;
internal class Configuration : IPluginConfiguration {
internal const int LatestVersion = 2;
public int Version { get; set; } = LatestVersion;
/// <summary>
/// This is a unique ID only sent to Sentry. It can be accessed and sent via
/// support channels to make finding error reports easier.
/// </summary>
public Guid UserId = Guid.NewGuid();
public bool FirstTimeSetupComplete;
public bool AutoUpdate = true;
public bool IncludeTags = true;
public bool OpenPenumbraAfterInstall = true;
public bool WarnAboutBreakingChanges = true;
public bool ReplaceSortName = true;
public bool HideDefaultVariant = true;
public bool UseNotificationProgress = true;
public bool NotificationsStartMinimised;
public bool AllowCommandInstalls = true;
public bool AllowCommandOneClick;
public bool UseRecycleBin;
public string TitlePrefix = "[HS] ";
public string PenumbraFolder = "Heliosphere";
public Guid? DefaultCollectionId;
public bool OneClick;
public byte[]? OneClickSalt;
public string? OneClickHash;
public Guid? OneClickCollectionId;
public ulong MaxKibsPerSecond;
public ulong AltMaxKibsPerSecond;
public SpeedLimit LimitNormal = SpeedLimit.On;
public SpeedLimit LimitInstance = SpeedLimit.Default;
public SpeedLimit LimitCombat = SpeedLimit.Default;
public SpeedLimit LimitParty = SpeedLimit.Default;
public PenumbraIntegration Penumbra = new();
public Configuration() {
}
internal Configuration(Configuration other) {
this.Version = other.Version;
this.UserId = other.UserId;
this.FirstTimeSetupComplete = other.FirstTimeSetupComplete;
this.AutoUpdate = other.AutoUpdate;
this.IncludeTags = other.IncludeTags;
this.OpenPenumbraAfterInstall = other.OpenPenumbraAfterInstall;
this.WarnAboutBreakingChanges = other.WarnAboutBreakingChanges;
this.ReplaceSortName = other.ReplaceSortName;
this.HideDefaultVariant = other.HideDefaultVariant;
this.UseNotificationProgress = other.UseNotificationProgress;
this.NotificationsStartMinimised = other.NotificationsStartMinimised;
this.AllowCommandInstalls = other.AllowCommandInstalls;
this.AllowCommandOneClick = other.AllowCommandOneClick;
this.UseRecycleBin = other.UseRecycleBin;
this.TitlePrefix = other.TitlePrefix;
this.PenumbraFolder = other.PenumbraFolder;
this.DefaultCollectionId = other.DefaultCollectionId;
this.OneClick = other.OneClick;
this.OneClickSalt = other.OneClickSalt;
this.OneClickHash = other.OneClickHash;
this.OneClickCollectionId = other.OneClickCollectionId;
this.MaxKibsPerSecond = other.MaxKibsPerSecond;
this.AltMaxKibsPerSecond = other.AltMaxKibsPerSecond;
this.LimitNormal = other.LimitNormal;
this.LimitInstance = other.LimitInstance;
this.LimitCombat = other.LimitCombat;
this.LimitParty = other.LimitParty;
}
private void Redact() {
if (this.OneClickSalt != null) {
this.OneClickSalt = [1];
}
if (this.OneClickHash != null) {
this.OneClickHash = "[redacted]";
}
}
internal static Configuration CloneAndRedact(Configuration other) {
var redacted = new Configuration(other);
redacted.Redact();
return redacted;
}
internal enum SpeedLimit {
Default,
On,
Alternate,
}
}
[Serializable]
internal class PenumbraIntegration {
public bool ShowImages = true;
public bool ShowButtons = true;
public float ImageSize = 0.375f;
}