Make reagent dispensers gridinv-based instead of pseudo-listinv (#34205)
This simplifies the code and makes the experience of examining contents easier without the reagent dispenser UI, as well as adding the possibility for dispensers to have items of heterogeneous sizes in them, which would allow configuring reagent dispensers to accept smaller containers such as beakers or vials in order to allow for more types of smaller quantities of reagents, or other flexibilities brought by using a standard storage component.
This commit is contained in:
committed by
GitHub
parent
942b2b4dcb
commit
5a0e0524ca
@@ -2,7 +2,6 @@ using Content.Shared.Whitelist;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Chemistry.Dispenser;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
@@ -15,47 +14,9 @@ namespace Content.Server.Chemistry.Components
|
||||
[Access(typeof(ReagentDispenserSystem))]
|
||||
public sealed partial class ReagentDispenserComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// String with the pack name that stores the initial fill of the dispenser. The initial
|
||||
/// fill is added to the dispenser on MapInit. Note that we don't use ContainerFill because
|
||||
/// we have to generate the storage slots at MapInit first, then fill them.
|
||||
/// </summary>
|
||||
[DataField("pack", customTypeSerializer:typeof(PrototypeIdSerializer<ReagentDispenserInventoryPrototype>))]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string? PackPrototypeId = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum number of internal storage slots. Dispenser can't store (or dispense) more than
|
||||
/// this many chemicals (without unloading and reloading).
|
||||
/// </summary>
|
||||
[DataField("numStorageSlots")]
|
||||
public int NumSlots = 25;
|
||||
|
||||
/// <summary>
|
||||
/// For each created storage slot for the reagent containers being dispensed, apply this
|
||||
/// entity whitelist. Makes sure weird containers don't fit in the dispenser and that beakers
|
||||
/// don't accidentally get slotted into the source slots.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntityWhitelist? StorageWhitelist;
|
||||
|
||||
[DataField]
|
||||
public ItemSlot BeakerSlot = new();
|
||||
|
||||
/// <summary>
|
||||
/// Prefix for automatically-generated slot name for storage, up to NumSlots.
|
||||
/// </summary>
|
||||
public static string BaseStorageSlotId = "ReagentDispenser-storageSlot";
|
||||
|
||||
/// <summary>
|
||||
/// List of storage slots that were created at MapInit.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public List<string> StorageSlotIds = new List<string>();
|
||||
|
||||
[DataField]
|
||||
public List<ItemSlot> StorageSlots = new List<ItemSlot>();
|
||||
|
||||
[DataField("clickSound"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public SoundSpecifier ClickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user