mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-07 13:05:41 +00:00
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using HarmonyLib;
|
|
using QSB.EchoesOfTheEye.SlideProjectors.Messages;
|
|
using QSB.EchoesOfTheEye.SlideProjectors.WorldObjects;
|
|
using QSB.Messaging;
|
|
using QSB.Patches;
|
|
using QSB.WorldSync;
|
|
|
|
namespace QSB.EchoesOfTheEye.SlideProjectors.Patches;
|
|
|
|
[HarmonyPatch(typeof(SlideProjector))]
|
|
internal class SlideProjectorPatches : QSBPatch
|
|
{
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
|
|
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch(nameof(SlideProjector.OnPressInteract))]
|
|
public static void OnPressInteract(SlideProjector __instance) =>
|
|
__instance.GetWorldObject<QSBSlideProjector>()
|
|
.SendMessage(new UseSlideProjectorMessage(true));
|
|
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch(nameof(SlideProjector.CancelInteraction))]
|
|
public static void CancelInteraction(SlideProjector __instance) =>
|
|
__instance.GetWorldObject<QSBSlideProjector>()
|
|
.SendMessage(new UseSlideProjectorMessage(false));
|
|
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch(nameof(SlideProjector.NextSlide))]
|
|
public static void NextSlide(SlideProjector __instance) =>
|
|
__instance.GetWorldObject<QSBSlideProjector>()
|
|
.SendMessage(new NextSlideMessage());
|
|
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch(nameof(SlideProjector.PreviousSlide))]
|
|
public static void PreviousSlide(SlideProjector __instance) =>
|
|
__instance.GetWorldObject<QSBSlideProjector>()
|
|
.SendMessage(new PreviousSlideMessage());
|
|
}
|