blob: df53e96f70615677b56147a64e6ccd5c2ddcfa31 (
plain) (
blame)
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
|
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using System.Reflection;
namespace ManifoldGardenArchipelago
{
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
internal static new ManualLogSource Logger;
public static ArchipelagoManager archipelagoManager = new();
public static SlotSave slotSave = new();
private void Awake()
{
// Plugin startup logic
Logger = base.Logger;
Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
GameData.Load();
archipelagoManager.Connect("localhost:38281", "Manifold", "").RunSynchronously();
}
}
[HarmonyPatch(typeof(GameManager), "Update")]
static class GameManagerUpdatePatch
{
static void Postfix()
{
Plugin.archipelagoManager.Update();
}
}
[HarmonyPatch(typeof(ButtonLineActivator), nameof(ButtonLineActivator.OnInteract))]
static class ButtonLineActivatorOnInteractPatch
{
public static void Postfix(ButtonLineActivator __instance)
{
Plugin.Logger.LogInfo($"Interacted with {__instance.name} in {__instance.gameObject.scene.name}: {__instance.isButtonPressed}");
}
}
}
|