add cloak to enterleave

This commit is contained in:
_nebula 2023-01-22 22:44:59 +00:00
parent 58e97e44a1
commit 9169283ac4
4 changed files with 13 additions and 0 deletions

View File

@ -37,4 +37,6 @@ public static class OWEvents
public const string StartShipIgnition = nameof(StartShipIgnition);
public const string CompleteShipIgnition = nameof(CompleteShipIgnition);
public const string CancelShipIgnition = nameof(CancelShipIgnition);
public const string EnterCloak = nameof(EnterCloak);
public const string ExitCloak = nameof(ExitCloak);
}

View File

@ -8,4 +8,6 @@ public enum EnterLeaveType
ExitPlatform,
EnterShip,
ExitShip,
EnterCloak,
ExitCloak
}

View File

@ -20,6 +20,8 @@ internal class EnterLeaveMessage : QSBMessage<EnterLeaveType>
GlobalMessenger.AddListener(OWEvents.PlayerExitQuantumMoon, () => Handler(EnterLeaveType.ExitMoon));
GlobalMessenger.AddListener(OWEvents.EnterShip, () => Handler(EnterLeaveType.EnterShip));
GlobalMessenger.AddListener(OWEvents.ExitShip, () => Handler(EnterLeaveType.ExitShip));
GlobalMessenger.AddListener(OWEvents.EnterCloak, () => Handler(EnterLeaveType.EnterCloak));
GlobalMessenger.AddListener(OWEvents.ExitCloak, () => Handler(EnterLeaveType.ExitCloak));
}
private static void Handler(EnterLeaveType type, int objectId = -1)
@ -62,6 +64,12 @@ internal class EnterLeaveMessage : QSBMessage<EnterLeaveType>
case EnterLeaveType.ExitMoon:
player.IsInMoon = false;
break;
case EnterLeaveType.EnterCloak:
player.IsInCloak = true;
break;
case EnterLeaveType.ExitCloak:
player.IsInCloak = false;
break;
case EnterLeaveType.EnterPlatform:
CustomNomaiRemoteCameraPlatform.CustomPlatformList[ObjectId]
.OnRemotePlayerEnter(From);

View File

@ -32,6 +32,7 @@ public partial class PlayerInfo
public bool IsInShrine { get; set; }
public bool IsInEyeShuttle { get; set; }
public bool IsInShip { get; set; }
public bool IsInCloak { get; set; }
public IQSBQuantumObject EntangledObject { get; set; }
public QSBPlayerAudioController AudioController { get; set; }
public bool IsLocalPlayer => TransformSync.isLocalPlayer; // if TransformSync is ever null, i give permission for nebula to make fun of me about it for the rest of time - johncorby