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}"); } } }