mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
31 lines
923 B
C#
31 lines
923 B
C#
using HarmonyLib;
|
|
using QSB.EchoesOfTheEye.AirlockSync.Messages;
|
|
using QSB.EchoesOfTheEye.AirlockSync.WorldObjects;
|
|
using QSB.Messaging;
|
|
using QSB.Patches;
|
|
using QSB.WorldSync;
|
|
using System.Linq;
|
|
|
|
namespace QSB.EchoesOfTheEye.AirlockSync.Patches;
|
|
|
|
public class AirlockPatches : QSBPatch
|
|
{
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(AirlockInterface), nameof(AirlockInterface.OnCallToOpenFront))]
|
|
public static bool Front(AirlockInterface __instance)
|
|
{
|
|
__instance.GetWorldObject<QSBAirlockInterface>().SendMessage(new AirlockCallToOpenMessage(true));
|
|
return true;
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(AirlockInterface), nameof(AirlockInterface.OnCallToOpenBack))]
|
|
public static bool Back(AirlockInterface __instance)
|
|
{
|
|
__instance.GetWorldObject<QSBAirlockInterface>().SendMessage(new AirlockCallToOpenMessage(false));
|
|
return true;
|
|
}
|
|
}
|