hide players who launch in shuttle

This commit is contained in:
Mister_Nebula 2022-01-13 16:38:34 +00:00
parent 864b29aec9
commit 62c4214184
3 changed files with 26 additions and 0 deletions

View File

@ -1,5 +1,7 @@
using QSB.EyeOfTheUniverse.EyeStateSync.Messages;
using QSB.Messaging;
using QSB.Player;
using QSB.Utility;
using QSB.WorldSync;
using System.Linq;
using UnityEngine;
@ -25,6 +27,9 @@ namespace QSB.EyeOfTheUniverse.MaskSync
GlobalMessenger<float, float>.FireEvent(OWEvents.FlickerOffAndOn, 0.5f, 0.5f);
_flickerOutTime = Time.time + 0.5f;
_flickering = true;
// hide all players in shuttle
QSBPlayerManager.PlayerList.Where(x => x.IsInEyeShuttle).ForEach(x => x.DitheringAnimator.SetVisibleImmediate(false));
}
private void Update()

View File

@ -39,6 +39,7 @@ namespace QSB.Player
public bool IsReady { get; set; }
public bool IsInMoon { get; set; }
public bool IsInShrine { get; set; }
public bool IsInEyeShuttle { get; set; }
public IQSBQuantumObject EntangledObject { get; set; }
public QSBPlayerAudioController AudioController { get; set; }
public DitheringAnimator DitheringAnimator { get; set; }

View File

@ -0,0 +1,20 @@
using QSB.Player;
namespace QSB.TriggerSync.WorldObjects
{
public class QSBEyeShuttleTrigger : QSBTrigger<EyeShuttleController>
{
public override void Init()
{
base.Init();
AttachedObject.OnEntry -= TriggerOwner.OnEnterShuttle;
AttachedObject.OnExit -= TriggerOwner.OnExitShuttle;
}
protected override void OnEnter(PlayerInfo player)
=> player.IsInEyeShuttle = true;
protected override void OnExit(PlayerInfo player)
=> player.IsInEyeShuttle = false;
}
}