Files
tbd-station-14/Content.Shared/SubFloor/TrayScannerComponent.cs
c4llv07e 3d6d7820d6 Fix tray scanner not updating it's range. (#26789)
Fix tray scanner not updating it's range on change.

Add range value to the tray scanner state.to synchronize it between
client and server.
2024-04-08 11:12:39 -04:00

33 lines
849 B
C#

using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.SubFloor;
[RegisterComponent, NetworkedComponent]
public sealed partial class TrayScannerComponent : Component
{
/// <summary>
/// Whether the scanner is currently on.
/// </summary>
[ViewVariables, DataField("enabled")] public bool Enabled;
/// <summary>
/// Radius in which the scanner will reveal entities. Centered on the <see cref="LastLocation"/>.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("range")]
public float Range = 4f;
}
[Serializable, NetSerializable]
public sealed class TrayScannerState : ComponentState
{
public bool Enabled;
public float Range;
public TrayScannerState(bool enabled, float range)
{
Enabled = enabled;
Range = range;
}
}