Add patch to call the event lol

This commit is contained in:
Mister_Nebula 2022-03-11 16:14:26 +00:00
parent a2469954f0
commit 33f9cdbf0a

View File

@ -0,0 +1,18 @@
using HarmonyLib;
using QSB.EchoesOfTheEye.PictureFrameDoors.Messages;
using QSB.EchoesOfTheEye.PictureFrameDoors.WorldObjects;
using QSB.Messaging;
using QSB.Patches;
using QSB.WorldSync;
namespace QSB.EchoesOfTheEye.PictureFrameDoors.Patches;
internal class PictureFrameDoorInterfacePatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
[HarmonyPostfix]
[HarmonyPatch(typeof(PictureFrameDoorInterface), nameof(PictureFrameDoorInterface.ToggleOpenState))]
public static void ToggleOpenState(PictureFrameDoorInterface __instance)
=> __instance.GetWorldObject<IQSBPictureFrameDoor>().SendMessage(new PictureFrameDoorMessage(__instance._door.IsOpen()));
}