forked from hajsdfgj/modular-overhaul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModConfig.cs
137 lines (105 loc) · 4.74 KB
/
ModConfig.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
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
namespace DaLion.Overhaul;
#region using directives
using DaLion.Shared.Extensions.SMAPI;
using DaLion.Shared.Integrations.GMCM.Attributes;
using Newtonsoft.Json;
using StardewModdingAPI.Utilities;
#endregion using directives
/// <summary>The collection of configs for each module.</summary>
public sealed class ModConfig
{
private static readonly Lazy<JsonSerializerSettings> JsonSerializerSettings =
new(() => ModHelper.Data.GetJsonSerializerSettings());
#region module flags
/// <summary>Gets a value indicating whether the Professions module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableProfessions { get; internal set; } = true;
#if DEBUG
/// <summary>Gets a value indicating whether the Combat module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableCombat { get; internal set; } = true;
/// <summary>Gets a value indicating whether the Tools module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableTools { get; internal set; } = true;
/// <summary>Gets a value indicating whether the Ponds module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnablePonds { get; internal set; } = true;
/// <summary>Gets a value indicating whether the Taxes module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableTaxes { get; internal set; } = true;
/// <summary>Gets a value indicating whether the Tweex module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableTweex { get; internal set; } = true;
#elif RELEASE
/// <summary>Gets a value indicating whether the Combat module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableCombat { get; internal set; } = false;
/// <summary>Gets a value indicating whether the Tools module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableTools { get; internal set; } = false;
/// <summary>Gets a value indicating whether the Ponds module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnablePonds { get; internal set; } = false;
/// <summary>Gets a value indicating whether the Taxes module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableTaxes { get; internal set; } = false;
/// <summary>Gets a value indicating whether the Tweex module is enabled.</summary>
[JsonProperty]
[GMCMIgnore]
public bool EnableTweex { get; internal set; } = true;
#endif
#endregion module flags
#region config sub-modules
/// <summary>Gets the Professions module config settings.</summary>
[JsonProperty]
[GMCMInnerConfig("DaLion.Overhaul.Modules.Professions", "prfs")]
public Modules.Professions.ProfessionConfig Professions { get; internal set; } = new();
/// <summary>Gets the Professions module config settings.</summary>
[JsonProperty]
[GMCMInnerConfig("DaLion.Overhaul.Modules.Combat", "cmbt")]
public Modules.Combat.CombatConfig Combat { get; internal set; } = new();
/// <summary>Gets the Tools module config settings.</summary>
[JsonProperty]
[GMCMInnerConfig("DaLion.Overhaul.Modules.Tools", "tols")]
public Modules.Tools.ToolConfig Tools { get; internal set; } = new();
/// <summary>Gets the Ponds module config settings.</summary>
[JsonProperty]
[GMCMInnerConfig("DaLion.Overhaul.Modules.Ponds", "pnds")]
public Modules.Ponds.PondConfig Ponds { get; internal set; } = new();
/// <summary>Gets the Taxes module config settings.</summary>
[JsonProperty]
[GMCMInnerConfig("DaLion.Overhaul.Modules.Taxes", "txs")]
public Modules.Taxes.TaxConfig Taxes { get; internal set; } = new();
/// <summary>Gets the Tweex module config settings.</summary>
[JsonProperty]
[GMCMInnerConfig("DaLion.Overhaul.Modules.Tweex", "twx")]
public Modules.Tweex.TweexConfig Tweex { get; internal set; } = new();
#endregion config sub-modules
/// <summary>Gets the key used to open the Generic Mod Config Menu directly at this mod.</summary>
[JsonProperty]
[GMCMIgnore]
public KeybindList OpenMenuKey { get; internal set; } = KeybindList.Parse("LeftShift + F12");
/// <summary>Gets the key used to engage Debug Mode.</summary>
[JsonProperty]
[GMCMIgnore]
public KeybindList DebugKey { get; internal set; } = KeybindList.Parse("OemQuotes, OemTilde");
/// <summary>Gets a value indicating whether to launch the first-time launch setup.</summary>
[JsonProperty]
[GMCMIgnore]
public bool LaunchInitialSetup { get; internal set; } = true;
/// <inheritdoc />
public override string ToString()
{
return JsonConvert.SerializeObject(this, JsonSerializerSettings.Value);
}
}