2022-03-14 15:54:50 +00:00
|
|
|
|
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;
|
|
|
|
|
|
2023-07-28 18:30:57 +00:00
|
|
|
|
public class AirlockPatches : QSBPatch
|
2022-03-14 15:54:50 +00:00
|
|
|
|
{
|
|
|
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(AirlockInterface), nameof(AirlockInterface.OnCallToOpenFront))]
|
|
|
|
|
public static bool Front(AirlockInterface __instance)
|
|
|
|
|
{
|
2022-03-14 19:49:38 +00:00
|
|
|
|
__instance.GetWorldObject<QSBAirlockInterface>().SendMessage(new AirlockCallToOpenMessage(true));
|
2022-03-14 15:54:50 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(AirlockInterface), nameof(AirlockInterface.OnCallToOpenBack))]
|
|
|
|
|
public static bool Back(AirlockInterface __instance)
|
|
|
|
|
{
|
2022-03-14 19:49:38 +00:00
|
|
|
|
__instance.GetWorldObject<QSBAirlockInterface>().SendMessage(new AirlockCallToOpenMessage(false));
|
2022-03-14 15:54:50 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|