CatStation/Content.Shared/SurveillanceCamera/Components/SurveillanceCameraComponent.cs
ScarKy0 4a88b375df
Make cameras react to the AI eye nearby (#43466)
* init

TODO:
Make this part of the surveillance camera system
Make this be bearable when unpowered(Probably commented out until we make AI lose vision without power)
Remove leftover shit
Probably clean up the camera RSI

* move to surv cameras, unpowered, remove leftovers

* silly

* review

* review

* I can see the light

* reverse fixtures

* review

* dependency query

* unused oops
2026-04-05 15:03:29 +00:00

57 lines
2 KiB
C#

using Content.Shared.DeviceNetwork;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.SurveillanceCamera.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedSurveillanceCameraSystem))]
public sealed partial class SurveillanceCameraComponent : Component
{
/// <summary>
/// List of active viewers who have a PVS view subscription on this camera.
/// This is for bookkeeping purposes,
/// so that when a camera shuts down, any entity viewing it
/// will immediately have their subscription revoked.
/// </summary>
[ViewVariables]
public HashSet<EntityUid> ActivePvsViewers { get; } = new();
/// <summary>
/// Monitors != Viewers, as viewers are entities that are tied
/// to a player session that's viewing from this camera
///
/// Monitors are grouped sets of viewers, and may be
/// completely different monitor types (e.g., monitor console,
/// AI, etc.)
/// </summary>
[ViewVariables]
public HashSet<EntityUid> ActiveMonitors { get; } = new();
// If this camera is active or not. Deactivating a camera
// will not allow it to obtain any new viewers.
[DataField]
public bool Active = true;
// This one isn't easy to deal with. Will require a UI
// to change/set this so mapping these in isn't
// the most terrible thing possible.
[DataField("id")]
public string CameraId = "camera";
/// <summary>
/// If true, instead of showing the camera id it will show the entity name
/// </summary>
[DataField]
public bool UseEntityNameAsCameraId = false;
[DataField, AutoNetworkedField]
public bool NameSet;
[DataField, AutoNetworkedField]
public bool NetworkSet;
// This has to be device network frequency prototypes.
[DataField("setupAvailableNetworks")]
public List<ProtoId<DeviceFrequencyPrototype>> AvailableNetworks { get; private set; } = new();
}