quantum-space-buddies/QSB/EchoesOfTheEye/PictureFrameDoors/Patches/PictureFrameDoorInterfacePatches.cs
2022-03-11 16:14:26 +00:00

19 lines
702 B
C#

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