-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFortEntrance.cs
91 lines (74 loc) · 2.52 KB
/
FortEntrance.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
83
84
85
86
87
88
89
90
91
using ArcherLoaderMod.Source.ModImport;
using FortRise;
using HarmonyLib;
using Monocle;
using MonoMod.ModInterop;
using TowerFall;
namespace ArcherLoaderMod
{
[Fort("com.reddude.archerLoader", "archer Loader")]
public class FortEntrance : FortModule
{
public static FortEntrance Instance;
public FortEntrance()
{
Instance = this;
}
public override Type SettingsType => typeof(ArcherLoaderSettings);
public static ArcherLoaderSettings Settings => (ArcherLoaderSettings)Instance.InternalSettings;
public override void LoadContent()
{
Mod.LoadContent(Content);
}
public override void Load()
{
var harmony = new Harmony("com.reddude.archerLoader");
harmony.PatchAll(typeof(FortEntrance).Assembly);
Mod.Load();
//Settings.FlightTest = () => { Music.Play("Flight"); };
//PinkSlime.LoadPatch();
//TriggerBrambleArrow.Load();
//PatchEnemyBramble.Load();
typeof(ModExports).ModInterop();
FortRise.RiseCore.Events.OnPreInitialize += OnPreInitialize;
}
public override void Unload()
{
Mod.Unload();
}
public override void OnVariantsRegister(VariantManager manager, bool noPerPlayer = false)
{
Mod.OnVariantsRegister(manager, noPerPlayer);
}
private void OnPreInitialize()
{
TfExAPIModImport.MarkModuleAsSafe?.Invoke(this);
}
}
// Harmony can be supported
//[HarmonyPatch(typeof(MainMenu), "BoolToString")]
//public class MyPatcher
//{
// static void Postfix(ref string __result)
// {
// if (__result == "ON")
// {
// __result = "ENABLED";
// return;
// }
// __result = "DISABLED";
// }
//}
/*
Example of interppting with libraries
Learn more: https://github.com/MonoMod/MonoMod/blob/master/README-ModInterop.md
*/
[ModExportName("CustomArcherLoaderModExport")]
public static class ModExports
{
public static Dictionary<ArcherData, ArcherCustomData> GetArcherCustomDataDict() => Mod.ArcherCustomDataDict;
public static List<Atlas> GetCustomAtlasList() => Mod.customAtlasList;
public static List<SpriteData> GetCustomSpriteDataList() => Mod.customSpriteDataList;
public static List<CharacterSounds> GetCustomSFXList() => Mod.customSFXList;
}
}