mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-13 21:40:50 +00:00
rename
This commit is contained in:
parent
3e4edb0bed
commit
8b49fb0147
@ -1,11 +0,0 @@
|
||||
using QSB.EchoesOfTheEye.AlarmTotemSync.WorldObjects;
|
||||
using QSB.Messaging;
|
||||
|
||||
namespace QSB.EchoesOfTheEye.AlarmTotemSync.Messages;
|
||||
|
||||
public class LocallyVisibleMessage : QSBWorldObjectMessage<QSBAlarmTotem, bool>
|
||||
{
|
||||
public LocallyVisibleMessage(bool visible) : base(visible) { }
|
||||
public override void OnReceiveLocal() => OnReceiveRemote();
|
||||
public override void OnReceiveRemote() => WorldObject.SetLocallyVisible(From, Data);
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
using QSB.EchoesOfTheEye.AlarmTotemSync.WorldObjects;
|
||||
using QSB.Messaging;
|
||||
|
||||
namespace QSB.EchoesOfTheEye.AlarmTotemSync.Messages;
|
||||
|
||||
public class SetVisibleMessage : QSBWorldObjectMessage<QSBAlarmTotem, bool>
|
||||
{
|
||||
public SetVisibleMessage(bool visible) : base(visible) { }
|
||||
public override void OnReceiveLocal() => OnReceiveRemote();
|
||||
public override void OnReceiveRemote() => WorldObject.SetVisible(From, Data);
|
||||
}
|
@ -15,6 +15,5 @@ public class VisibleForMessage : QSBWorldObjectMessage<QSBAlarmTotem, List<uint>
|
||||
{
|
||||
WorldObject.VisibleFor.Clear();
|
||||
WorldObject.VisibleFor.AddRange(Data);
|
||||
WorldObject.UpdateVisible();
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class AlarmTotemPatches : QSBPatch
|
||||
|
||||
if (QSBWorldSync.AllObjectsReady)
|
||||
{
|
||||
__instance.GetWorldObject<QSBAlarmTotem>().SendMessage(new LocallyVisibleMessage(true));
|
||||
__instance.GetWorldObject<QSBAlarmTotem>().SendMessage(new SetVisibleMessage(true));
|
||||
}
|
||||
}
|
||||
else if (isPlayerVisible && !__instance._isPlayerVisible)
|
||||
@ -88,7 +88,7 @@ public class AlarmTotemPatches : QSBPatch
|
||||
|
||||
if (QSBWorldSync.AllObjectsReady)
|
||||
{
|
||||
__instance.GetWorldObject<QSBAlarmTotem>().SendMessage(new LocallyVisibleMessage(false));
|
||||
__instance.GetWorldObject<QSBAlarmTotem>().SendMessage(new SetVisibleMessage(false));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class QSBAlarmTotem : WorldObject<AlarmTotem>
|
||||
{
|
||||
if (AttachedObject._isPlayerVisible)
|
||||
{
|
||||
this.SendMessage(new LocallyVisibleMessage(true));
|
||||
this.SendMessage(new SetVisibleMessage(true));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -39,7 +39,7 @@ public class QSBAlarmTotem : WorldObject<AlarmTotem>
|
||||
private void OnPlayerLeave(PlayerInfo player) =>
|
||||
VisibleFor.QuickRemove(player.PlayerId);
|
||||
|
||||
public void SetLocallyVisible(uint playerId, bool visible)
|
||||
public void SetVisible(uint playerId, bool visible)
|
||||
{
|
||||
if (visible)
|
||||
{
|
||||
@ -49,31 +49,6 @@ public class QSBAlarmTotem : WorldObject<AlarmTotem>
|
||||
{
|
||||
VisibleFor.QuickRemove(playerId);
|
||||
}
|
||||
|
||||
UpdateVisible();
|
||||
}
|
||||
|
||||
public void UpdateVisible()
|
||||
{
|
||||
if (AttachedObject._isPlayerVisible && VisibleFor.Count < 1)
|
||||
{
|
||||
Locator.GetAlarmSequenceController().IncreaseAlarmCounter();
|
||||
AttachedObject._simTotemMaterials[0] = AttachedObject._simAlarmMaterial;
|
||||
AttachedObject._simTotemRenderer.sharedMaterials = AttachedObject._simTotemMaterials;
|
||||
AttachedObject._simVisionConeRenderer.SetColor(AttachedObject._simAlarmColor);
|
||||
if (AttachedObject._isTutorialTotem)
|
||||
{
|
||||
GlobalMessenger.FireEvent("TutorialAlarmTotemTriggered");
|
||||
}
|
||||
}
|
||||
else if (!AttachedObject._isPlayerVisible && VisibleFor.Count >= 1)
|
||||
{
|
||||
Locator.GetAlarmSequenceController().DecreaseAlarmCounter();
|
||||
AttachedObject._simTotemMaterials[0] = AttachedObject._origSimEyeMaterial;
|
||||
AttachedObject._simTotemRenderer.sharedMaterials = AttachedObject._simTotemMaterials;
|
||||
AttachedObject._simVisionConeRenderer.SetColor(AttachedObject._simVisionConeRenderer.GetOriginalColor());
|
||||
AttachedObject._pulseLightController.FadeTo(0f, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetEnabled(bool enabled)
|
||||
|
Loading…
x
Reference in New Issue
Block a user