mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-07 13:05:41 +00:00
22 lines
710 B
C#
22 lines
710 B
C#
using OWML.Utils;
|
|
using QSB.Events;
|
|
using QSB.Patches;
|
|
|
|
namespace QSB.ElevatorSync.Patches
|
|
{
|
|
public class ElevatorPatches : QSBPatch
|
|
{
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart;
|
|
|
|
public static void StartLift(Elevator __instance)
|
|
{
|
|
var isGoingUp = __instance.GetValue<bool>("_goingToTheEnd");
|
|
var id = ElevatorManager.Instance.GetId(__instance);
|
|
QSBEventManager.FireEvent(EventNames.QSBStartLift, id, isGoingUp);
|
|
}
|
|
|
|
public override void DoPatches() => QSBCore.Helper.HarmonyHelper.AddPostfix<Elevator>("StartLift", typeof(ElevatorPatches), nameof(StartLift));
|
|
|
|
public override void DoUnpatches() => QSBCore.Helper.HarmonyHelper.Unpatch<Elevator>("StartLift");
|
|
}
|
|
} |