Files
ss14-wl/Content.Shared/_White/Overlays/SwitchableVisionOverlayComponent.cs
JunJun ae8d7ab59d Thermal and Night Vision update (#429)
* base

* fix

* fix

* fix2

* xeno

* xenoborg + locale
2025-12-15 14:19:24 +03:00

59 lines
1.5 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared._White.Overlays;
public abstract partial class SwitchableVisionOverlayComponent : BaseVisionOverlayComponent
{
[DataField]
public bool IsActive;
[DataField]
public bool DrawOverlay = true;
[DataField]
public float OverlayOpacity = 0.5f;
/// <summary>
/// Whether it should grant equipment enhanced vision or is it mob vision
/// </summary>
[DataField]
public bool IsEquipment;
/// <summary>
/// If it is greater than 0, overlay isn't toggled but pulsed instead
/// </summary>
[DataField]
public float PulseTime;
[ViewVariables(VVAccess.ReadOnly)]
public float PulseAccumulator;
[DataField]
public SoundSpecifier? ActivateSound = new SoundPathSpecifier("/Audio/_White/Items/Goggles/activate.ogg");
[DataField]
public SoundSpecifier? DeactivateSound = new SoundPathSpecifier("/Audio/_White/Items/Goggles/deactivate.ogg");
[DataField]
public virtual EntProtoId? ToggleAction { get; set; }
[ViewVariables]
public EntityUid? ToggleActionEntity;
}
[Serializable, NetSerializable]
public sealed class SwitchableVisionOverlayComponentState : IComponentState
{
public Color Color;
public bool IsEquipment;
public bool IsActive;
public SoundSpecifier? ActivateSound;
public SoundSpecifier? DeactivateSound;
public EntProtoId? ToggleAction;
public float LightRadius;
public bool DrawOverlay;
public float OverlayOpacity;
}