forked from Bentechy66/HollowKnight.BreakableWallRandomizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBreakableWallRandomizer.cs
82 lines (76 loc) · 2.82 KB
/
BreakableWallRandomizer.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
using BreakableWallRandomizer.Settings;
using BreakableWallRandomizer.Manager;
using BreakableWallRandomizer.Interop;
using Modding;
using System;
namespace BreakableWallRandomizer
{
public class BreakableWallRandomizer : Mod, IGlobalSettings<BWR_Settings>
{
new public string GetName() => "Breakable Wall Randomizer";
public override string GetVersion() => "3.0.4.0";
public BWR_Settings GS { get; set; } = new();
private static BreakableWallRandomizer _instance;
public BreakableWallRandomizer() : base()
{
_instance = this;
}
internal static BreakableWallRandomizer Instance
{
get
{
if (_instance == null)
{
throw new InvalidOperationException($"{nameof(BreakableWallRandomizer)} was never initialized");
}
return _instance;
}
}
public override void Initialize()
{
Log("Initializing...");
BWR_Manager.Hook();
if (ModHooks.GetMod("FStatsMod") is Mod)
FStats_Interop.Hook();
if (ModHooks.GetMod("Randomizer 4") is Mod)
{
if (ModHooks.GetMod("MoreLocations") is Mod)
MoreLocations_Interop.Hook();
if (ModHooks.GetMod("RandoSettingsManager") is Mod)
RSM_Interop.Hook();
}
CondensedSpoilerLogger.AddCategory("Grub Walls", () => BWR_Manager.Settings.Enabled,
[
"Dive_Floor-Basin_Grub",
"Wall-Catacombs_Grub",
"Wall-Crossroads_Grub",
"Wall-Deepnest_Mimics",
"Wall-Deepnest_Springs_Grub",
"Wall-Edge_Camp_Grub",
"Wall-Peak_Mimic",
"Wall-Waterways_Grub"
]
);
CondensedSpoilerLogger.AddCategory("Access Walls", () => BWR_Manager.Settings.Enabled,
[
"Dive_Floor-Flukemarm",
"Dive_Floor-Peak_Entrance",
"Plank-Colo_Shortcut",
"Plank-Edge_Tram_Exit",
"Plank-Hive_Exit",
"Plank-Nailsmith",
"Wall-Hidden_Station",
"Wall-Junk_Pit_Entrance",
"Wall-Lower_Hive_Entrance",
"Wall-Path_of_Pain_Entrance",
"Wall-Pleasure_House",
"Wall-Shade_Soul_Shortcut",
"Wall-Weaver's_Den_Entrance"
]
);
Log("Initialized.");
}
public void OnLoadGlobal(BWR_Settings s) => GS = s;
public BWR_Settings OnSaveGlobal() => GS;
}
}