Files
tbd-station-14/Content.Server/PDA/PDAComponent.cs
Leon Friedrich 91b185e3c2 Rejigging Item slots (#4933)
* itemslot overhaul

* remove "shared" prefix

* handle component shutdown

* comments, cleanup, tests

* comments and minor tweak

* rename ItemSlotManagerState

* fix swapping

* fix merge

* Add ItemSlot verb text override

* fix merge  (IEntity -> entityUid)

* Fix merge (LabelSystem)

* Fix merge (nuke disk)

* fix test
2021-11-19 22:26:01 -07:00

36 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using Content.Server.Access.Components;
using Content.Shared.Containers.ItemSlots;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables;
namespace Content.Server.PDA
{
[RegisterComponent]
public class PDAComponent : Component
{
public override string Name => "PDA";
[DataField("idSlot")]
public ItemSlot IdSlot = new();
[DataField("penSlot")]
public ItemSlot PenSlot = 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("idCard", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? IdCard;
[ViewVariables] public IdCardComponent? ContainedID;
[ViewVariables] public bool FlashlightOn;
[ViewVariables] public string? OwnerName;
}
}