-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCombatRandomizer.cs
More file actions
50 lines (44 loc) · 1.47 KB
/
Copy pathCombatRandomizer.cs
File metadata and controls
50 lines (44 loc) · 1.47 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
using CombatRandomizer.Interop;
using CombatRandomizer.Manager;
using CombatRandomizer.Settings;
using Modding;
using System;
namespace CombatRandomizer
{
public class CombatRandomizer : Mod, IGlobalSettings<CombatSettings>
{
new public string GetName() => "CombatRandomizer";
public override string GetVersion() => "1.1.0.2";
private static CombatRandomizer _instance;
public CombatRandomizer() : base()
{
_instance = this;
}
internal static CombatRandomizer Instance
{
get
{
if (_instance == null)
{
throw new InvalidOperationException($"{nameof(CombatRandomizer)} was never initialized");
}
return _instance;
}
}
public CombatSettings GS { get; internal set; } = new();
public override void Initialize()
{
// Ignore completely if Randomizer 4 is inactive
if (ModHooks.GetMod("Randomizer 4") is Mod)
{
Instance.Log("Initializing...");
CombatManager.Hook();
if (ModHooks.GetMod("RandoSettingsManager") is Mod)
RSM_Interop.Hook();
Instance.Log("Initialized.");
}
}
public void OnLoadGlobal(CombatSettings s) => GS = s;
public CombatSettings OnSaveGlobal() => GS;
}
}