-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDebugInterop.cs
More file actions
27 lines (24 loc) · 1012 Bytes
/
Copy pathDebugInterop.cs
File metadata and controls
27 lines (24 loc) · 1012 Bytes
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
using System.Reflection;
using MonoMod.RuntimeDetour;
namespace MoreStags {
public class DebugInterop {
private static Hook stagHook;
public static void HookDebug() {
MethodInfo methodToHook = typeof(DebugMod.BindableFunctions).GetMethod(nameof(DebugMod.BindableFunctions.AllStags));
stagHook = new Hook(methodToHook, doAllStags);
}
public static void doAllStags() {
PlayerData pd = PlayerData.instance;
foreach(string pdBool in new string[] { "openedTownBuilding", "gladeDoorOpened", "troupeInTown"}) {
pd.SetBool(pdBool, true);
}
foreach(StagData data in MoreStags.localData.activeStags) {
if(data.isVanilla)
pd.SetBool(Consts.OpenedNames[data.name], true);
else
MoreStags.localData.opened[data.name] = true;
}
DebugMod.Console.AddLine("Unlocked all active stags");
}
}
}