Make ItemCabinet use ItemSlots (#4771)
* pda slot names * cabinets use item slots * fix yaml * fix tests
This commit is contained in:
@@ -2,6 +2,7 @@ using Content.Shared.Sound;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
@@ -31,9 +32,23 @@ namespace Content.Shared.Containers.ItemSlots
|
||||
[ViewVariables] [DataField("insertSound")] public SoundSpecifier? InsertSound;
|
||||
[ViewVariables] [DataField("ejectSound")] public SoundSpecifier? EjectSound;
|
||||
|
||||
/// <summary>
|
||||
/// The name of this item slot. This will be shown to the user in the verb menu.
|
||||
/// </summary>
|
||||
[ViewVariables] public string Name
|
||||
{
|
||||
get => _name != string.Empty
|
||||
? Loc.GetString(_name)
|
||||
: ContainerSlot.ContainedEntity?.Name ?? string.Empty;
|
||||
set => _name = value;
|
||||
}
|
||||
[DataField("name")] private string _name = string.Empty;
|
||||
|
||||
[DataField("item", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
[ViewVariables] public string? StartingItem;
|
||||
|
||||
[ViewVariables] public ContainerSlot ContainerSlot = default!;
|
||||
|
||||
public bool HasEntity => ContainerSlot.ContainedEntity != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user