CatStation/Content.Shared/PDA/PdaComponent.cs
deltanedas cf7fde3d62
Big prototype and datafield cleanup (#45202)
* giant protoid cleanup

* yml changes

* !

---------

Co-authored-by: deltanedas <@deltanedas:goida.zip>
2026-08-12 02:07:22 +00:00

43 lines
1.6 KiB
C#

using Content.Shared.AlertLevel;
using Content.Shared.Containers.ItemSlots;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.PDA
{
[RegisterComponent, NetworkedComponent]
public sealed partial class PdaComponent : Component
{
public const string PdaIdSlotId = "PDA-id";
public const string PdaPenSlotId = "PDA-pen";
public const string PdaPaiSlotId = "PDA-pai";
[DataField]
public ItemSlot IdSlot = new();
[DataField]
public ItemSlot PenSlot = new();
[DataField]
public ItemSlot PaiSlot = new();
// Really this should just be using ItemSlot.StartingItem. However, seeing as we have so many different starting
// PDA's and no nice way to inherit the other fields from the ItemSlot data definition, this makes the yaml much
// nicer to read.
[DataField("id")]
public EntProtoId? IdCard;
// TODO: Fix persistence
[ViewVariables] public EntityUid? ContainedId;
[ViewVariables] public bool FlashlightOn;
[ViewVariables(VVAccess.ReadWrite)] public string? OwnerName;
// The Entity that "owns" the PDA, usually a player's character.
// This is useful when we are doing stuff like renaming a player and want to find their PDA to change the name
// as well.
[ViewVariables(VVAccess.ReadWrite)] public EntityUid? PdaOwner;
[ViewVariables] public string? StationName;
[ViewVariables]
public ProtoId<AlertLevelPrototype>? StationAlertLevel;
[ViewVariables] public Color StationAlertColor = Color.White;
}
}