mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 09:35:26 +00:00
23 lines
699 B
C#
23 lines
699 B
C#
using OWML.ModHelper.Events;
|
|
using QSB.EventsCore;
|
|
|
|
namespace QSB.ElevatorSync
|
|
{
|
|
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);
|
|
GlobalMessenger<int, bool>.FireEvent(EventNames.QSBStartLift, id, isGoingUp);
|
|
}
|
|
|
|
public override void DoPatches()
|
|
{
|
|
QSB.Helper.HarmonyHelper.AddPostfix<Elevator>("StartLift", typeof(ElevatorPatches), nameof(StartLift));
|
|
}
|
|
}
|
|
}
|