mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-06 22:37:27 +00:00
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.
(cherry picked from commit 3d6d7820d6)
33 lines
849 B
C#
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;
|
|
}
|
|
}
|