-
Notifications
You must be signed in to change notification settings - Fork 1
/
GodhomeRandomizer.cs
64 lines (61 loc) · 2.23 KB
/
GodhomeRandomizer.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
using GodhomeRandomizer.Interop;
using GodhomeRandomizer.Manager;
using GodhomeRandomizer.Settings;
using Modding;
using System;
namespace GodhomeRandomizer
{
public class GodhomeRandomizer : Mod, IGlobalSettings<GodhomeRandomizerSettings>
{
new public string GetName() => "GodhomeRandomizer";
public override string GetVersion() => "2.2.4.8";
private static GodhomeRandomizer _instance;
public GodhomeRandomizer() : base()
{
_instance = this;
}
internal static GodhomeRandomizer Instance
{
get
{
if (_instance == null)
{
throw new InvalidOperationException($"{nameof(GodhomeRandomizer)} was never initialized");
}
return _instance;
}
}
public GodhomeRandomizerSettings GS { get; set; } = new();
public override void Initialize()
{
// Ignore completely if Randomizer 4 is inactive
if (ModHooks.GetMod("Randomizer 4") is Mod)
{
Log("Initializing");
GodhomeManager.Hook();
if (ModHooks.GetMod("FStatsMod") is Mod)
{
FStats_Interop.Hook();
}
if (ModHooks.GetMod("MoreLocations") is Mod)
{
MoreLocations_Interop.Hook();
}
if (ModHooks.GetMod("RandoSettingsManager") is Mod)
{
RSM_Interop.Hook();
}
CondensedSpoilerLogger.AddCategory("Pantheon Completion", () => GodhomeManager.GlobalSettings.Enabled && GodhomeManager.GlobalSettings.Pantheons.Completion,
[
"Pantheon_Master-Completion", "Pantheon_Artist-Completion",
"Pantheon_Sage-Completion", "Pantheon_Knight-Completion",
"Pantheon_Hallownest-Completion"
]
);
Log("Initialized");
}
}
public void OnLoadGlobal(GodhomeRandomizerSettings s) => GS = s;
public GodhomeRandomizerSettings OnSaveGlobal() => GS;
}
}