-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
42 lines (35 loc) · 1.08 KB
/
Copy pathPlugin.cs
File metadata and controls
42 lines (35 loc) · 1.08 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
using Archipelago.UI;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Logger = BepInEx.Logging.Logger;
namespace Archipelago;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
internal static new ManualLogSource? Logger;
private static Harmony? harmony;
private static SimpleUI? ui;
private void Awake()
{
harmony = new Harmony(MyPluginInfo.PLUGIN_GUID);
Logger = base.Logger;
var DisableMod = Config.Bind("General", "DisableMod", false, "Temporarily disables the Archipelago mod without uninstalling.");
if (DisableMod.Value)
{
Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is disabled!");
return;
}
Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
harmony.PatchAll();
ui = gameObject.AddComponent<SimpleUI>();
}
public static void Exit()
{
if (ui != null)
{
Destroy(ui);
}
harmony?.UnpatchSelf();
}
}