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
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Chemistry
|
||||
@@ -66,11 +67,25 @@ namespace Content.Shared.Chemistry
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ReagentDispenserDispenseReagentMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly string SlotId;
|
||||
public readonly ItemStorageLocation StorageLocation;
|
||||
|
||||
public ReagentDispenserDispenseReagentMessage(string slotId)
|
||||
public ReagentDispenserDispenseReagentMessage(ItemStorageLocation storageLocation)
|
||||
{
|
||||
SlotId = slotId;
|
||||
StorageLocation = storageLocation;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Message sent by the user interface to ask the reagent dispenser to eject a container
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ReagentDispenserEjectContainerMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly ItemStorageLocation StorageLocation;
|
||||
|
||||
public ReagentDispenserEjectContainerMessage(ItemStorageLocation storageLocation)
|
||||
{
|
||||
StorageLocation = storageLocation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,9 +109,9 @@ namespace Content.Shared.Chemistry
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ReagentInventoryItem(string storageSlotId, string reagentLabel, FixedPoint2 quantity, Color reagentColor)
|
||||
public sealed class ReagentInventoryItem(ItemStorageLocation storageLocation, string reagentLabel, FixedPoint2 quantity, Color reagentColor)
|
||||
{
|
||||
public string StorageSlotId = storageSlotId;
|
||||
public ItemStorageLocation StorageLocation = storageLocation;
|
||||
public string ReagentLabel = reagentLabel;
|
||||
public FixedPoint2 Quantity = quantity;
|
||||
public Color ReagentColor = reagentColor;
|
||||
|
||||
Reference in New Issue
Block a user