-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAccessRandomizer.cs
More file actions
68 lines (63 loc) · 2.57 KB
/
Copy pathAccessRandomizer.cs
File metadata and controls
68 lines (63 loc) · 2.57 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
using AccessRandomizer.Interop;
using AccessRandomizer.Manager;
using AccessRandomizer.Settings;
using Modding;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace AccessRandomizer
{
public class AccessRandomizer : Mod, IGlobalSettings<AccessSettings>
{
new public string GetName() => "AccessRandomizer";
public static GameObject slyDoor;
public override string GetVersion() => "1.4.1.0";
private static AccessRandomizer _instance;
public AccessRandomizer() : base()
{
_instance = this;
}
internal static AccessRandomizer Instance
{
get
{
if (_instance == null)
{
throw new InvalidOperationException($"{nameof(AccessRandomizer)} was never initialized");
}
return _instance;
}
}
public AccessSettings GS { get; internal set; } = new();
public override List<(string, string)> GetPreloadNames() {
return [("Crossroads_04", "_Transition Gates/Mender Door")];
}
public override void Initialize(Dictionary<string, Dictionary<string, GameObject>> preloads)
{
// Ignore completely if Randomizer 4 is inactive
if (ModHooks.GetMod("Randomizer 4") is Mod)
{
Instance.Log("Initializing...");
slyDoor = preloads["Crossroads_04"]["_Transition Gates/Mender Door"];
AccessManager.Hook();
if (ModHooks.GetMod("RandoSettingsManager") is Mod)
RSM_Interop.Hook();
if (ModHooks.GetMod("FStatsMod") is Mod)
FStats_Interop.Hook();
CondensedSpoilerLogger.AddCategory("Miscellaneous Access", () => AccessManager.Settings.Enabled,
[
"Mantis_Respect", "Hollow_Knight_Chain",
"Graveyard_Key", "Waterways_Key", "Pleasure_Key", "Coffin_Key",
"Birthplace_Key", "Bretta_Key", "Glade_Key", "Mapper_Key", "Relic_Key", "Sly_Key", "Zote_Key",
"Left_Elevator_Pass", "Right_Elevator_Pass",
"Upper_Tram_Pass", "Lower_Tram_Pass",
"Trap_Bench"
]
);
Instance.Log("Initialized.");
}
}
public void OnLoadGlobal(AccessSettings s) => GS = s;
public AccessSettings OnSaveGlobal() => GS;
}
}