Add limited-reagent dispensers (#23907)

* Add limited-reagent dispensers

* Add empty versions for all dispensers

* Fix lint

* Set initial window size so all buttons are visible

* Simplify logic, add parenthesis

* Use localized name for initial labels

* Adjust button style

* Avoid touching items before MapInit

* Remove pre-labeling

* Reduce diff

* Clean up YAML

* Fix test

* Really fix test

* Document

* Adjust based on review

* Add labels for obnoxiously long bottles

---------

Co-authored-by: AWF <you@example.com>
This commit is contained in:
Kevin Zheng
2024-01-17 13:43:48 -08:00
committed by GitHub
parent 47159d1c23
commit 9394a26245
19 changed files with 609 additions and 168 deletions

View File

@@ -8,7 +8,7 @@ namespace Content.Shared.Chemistry
/// </summary>
public sealed class SharedReagentDispenser
{
public const string OutputSlotName = "beakerSlot";
public const string OutputSlotName = "ReagentDispenser-beakerSlot";
}
[Serializable, NetSerializable]
@@ -25,11 +25,11 @@ namespace Content.Shared.Chemistry
[Serializable, NetSerializable]
public sealed class ReagentDispenserDispenseReagentMessage : BoundUserInterfaceMessage
{
public readonly ReagentId ReagentId;
public readonly string SlotId;
public ReagentDispenserDispenseReagentMessage(ReagentId reagentId)
public ReagentDispenserDispenseReagentMessage(string slotId)
{
ReagentId = reagentId;
SlotId = slotId;
}
}
@@ -59,11 +59,11 @@ namespace Content.Shared.Chemistry
/// <summary>
/// A list of the reagents which this dispenser can dispense.
/// </summary>
public readonly List<ReagentId> Inventory;
public readonly List<KeyValuePair<string, KeyValuePair<string, string>>> Inventory;
public readonly ReagentDispenserDispenseAmount SelectedDispenseAmount;
public ReagentDispenserBoundUserInterfaceState(ContainerInfo? outputContainer, List<ReagentId> inventory, ReagentDispenserDispenseAmount selectedDispenseAmount)
public ReagentDispenserBoundUserInterfaceState(ContainerInfo? outputContainer, List<KeyValuePair<string, KeyValuePair<string, string>>> inventory, ReagentDispenserDispenseAmount selectedDispenseAmount)
{
OutputContainer = outputContainer;
Inventory = inventory;