1
0

PdaComponent.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Robust.Shared.Prototypes;
  2. using Robust.Shared.GameStates;
  3. using Content.Shared.Access.Components;
  4. using Content.Shared.Containers.ItemSlots;
  5. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  6. namespace Content.Shared.PDA
  7. {
  8. [RegisterComponent, NetworkedComponent]
  9. public sealed partial class PdaComponent : Component
  10. {
  11. public const string PdaIdSlotId = "PDA-id";
  12. public const string PdaPenSlotId = "PDA-pen";
  13. public const string PdaPaiSlotId = "PDA-pai";
  14. [DataField("idSlot")]
  15. public ItemSlot IdSlot = new();
  16. [DataField("penSlot")]
  17. public ItemSlot PenSlot = new();
  18. [DataField("paiSlot")]
  19. public ItemSlot PaiSlot = new();
  20. // Really this should just be using ItemSlot.StartingItem. However, seeing as we have so many different starting
  21. // PDA's and no nice way to inherit the other fields from the ItemSlot data definition, this makes the yaml much
  22. // nicer to read.
  23. [DataField("id", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
  24. public string? IdCard;
  25. [ViewVariables] public EntityUid? ContainedId;
  26. [ViewVariables] public bool FlashlightOn;
  27. [ViewVariables(VVAccess.ReadWrite)] public string? OwnerName;
  28. // The Entity that "owns" the PDA, usually a player's character.
  29. // This is useful when we are doing stuff like renaming a player and want to find their PDA to change the name
  30. // as well.
  31. [ViewVariables(VVAccess.ReadWrite)] public EntityUid? PdaOwner;
  32. [ViewVariables] public string? StationName;
  33. [ViewVariables] public string? StationAlertLevel;
  34. [ViewVariables] public Color StationAlertColor = Color.White;
  35. }
  36. }