Allow solutions to store extra reagent data (#19323)
This commit is contained in:
@@ -83,7 +83,7 @@ namespace Content.Client.Kitchen.UI
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshContentsDisplay(IList<Solution.ReagentQuantity>? reagents, IReadOnlyList<EntityUid> containedSolids, bool isBeakerAttached)
|
||||
private void RefreshContentsDisplay(IList<ReagentQuantity>? reagents, IReadOnlyList<EntityUid> containedSolids, bool isBeakerAttached)
|
||||
{
|
||||
//Refresh chamber contents
|
||||
_chamberVisualContents.Clear();
|
||||
@@ -118,9 +118,11 @@ namespace Content.Client.Kitchen.UI
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var reagent in reagents)
|
||||
foreach (var (reagent, quantity) in reagents)
|
||||
{
|
||||
var reagentName = _prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype? proto) ? Loc.GetString($"{reagent.Quantity} {proto.LocalizedName}") : "???";
|
||||
var reagentName = _prototypeManager.TryIndex(reagent.Prototype, out ReagentPrototype? proto)
|
||||
? Loc.GetString($"{quantity} {proto.LocalizedName}")
|
||||
: "???";
|
||||
BeakerContentBox.BoxContents.AddItem(reagentName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Kitchen.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -17,7 +18,7 @@ namespace Content.Client.Kitchen.UI
|
||||
private readonly Dictionary<int, EntityUid> _solids = new();
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<int, Solution.ReagentQuantity> _reagents = new();
|
||||
private readonly Dictionary<int, ReagentQuantity> _reagents = new();
|
||||
|
||||
public MicrowaveBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user