-<Control xmlns="https://spacestation14.io">
+<Control xmlns="https://spacestation14.io" HorizontalExpand="True">
<BoxContainer Name="MainContainer"
Orientation="Horizontal"
- SetWidth="160">
+ HorizontalExpand="True">
<PanelContainer Name="ColorPanel"
VerticalExpand="True"
SetWidth="7"
VerticalExpand="True"
HorizontalExpand="True"
Margin="-5 0 0 0">
- <Label Name="ReagentNameLabel"
- StyleClasses="LabelSubText" />
+ <Label Name="ReagentNameLabel" />
<Label Name="FillLabel"
StyleClasses="LabelSubText"
Margin="0 -5 0 0" />
StorageSlotId = item.StorageSlotId;
ColorPanel.PanelOverride = new StyleBoxFlat { BackgroundColor = item.ReagentColor };
ReagentNameLabel.Text = item.ReagentLabel;
- ReagentNameLabel.FontColorOverride = Color.White;
- FillLabel.Text = item.StoredAmount;
+ FillLabel.Text = Loc.GetString("reagent-dispenser-window-quantity-label-text", ("quantity", item.Quantity));;
EjectButtonIcon.Text = Loc.GetString("reagent-dispenser-window-eject-container-button");
+ if (item.Quantity == 0.0)
+ MainButton.Disabled = true;
+
MainButton.OnPressed += args => OnPressed?.Invoke(StorageSlotId);
EjectButton.OnPressed += args => OnEjectButtonPressed?.Invoke(StorageSlotId);
}
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
xmlns:ui="clr-namespace:Content.Client.Chemistry.UI"
Title="{Loc 'reagent-dispenser-bound-user-interface-title'}"
- MinSize="680 460">
+ MinSize="600 300"
+ SetSize="800 500">
<BoxContainer Orientation="Horizontal">
<BoxContainer Orientation="Vertical" MinWidth="170">
<Label Text="{Loc 'reagent-dispenser-window-amount-to-dispense-label'}" HorizontalAlignment="Center" />
}
}
}
-
- public sealed class DispenseReagentButton : Button
- {
- public string ReagentId { get; }
-
- public DispenseReagentButton(string reagentId, string text, string amount)
- {
- AddStyleClass("OpenRight");
- ReagentId = reagentId;
- Text = text + " " + amount;
- }
- }
-
- public sealed class EjectJugButton : Button
- {
- public string ReagentId { get; }
-
- public EjectJugButton(string reagentId)
- {
- AddStyleClass("OpenLeft");
- ReagentId = reagentId;
- Text = "⏏";
- }
- }
}
quantity = sol.Volume;
reagentColor = sol.GetColor(_prototypeManager);
}
- var storedAmount = Loc.GetString("reagent-dispenser-window-quantity-label-text", ("quantity", quantity));
- inventory.Add(new ReagentInventoryItem(storageSlotId, reagentLabel, storedAmount, reagentColor));
+ inventory.Add(new ReagentInventoryItem(storageSlotId, reagentLabel, quantity, reagentColor));
}
return inventory;
using Content.Shared.Chemistry.Reagent;
+using Content.Shared.FixedPoint;
using Robust.Shared.Serialization;
namespace Content.Shared.Chemistry
}
[Serializable, NetSerializable]
- public sealed class ReagentInventoryItem(string storageSlotId, string reagentLabel, string storedAmount, Color reagentColor)
+ public sealed class ReagentInventoryItem(string storageSlotId, string reagentLabel, FixedPoint2 quantity, Color reagentColor)
{
public string StorageSlotId = storageSlotId;
public string ReagentLabel = reagentLabel;
- public string StoredAmount = storedAmount;
+ public FixedPoint2 Quantity = quantity;
public Color ReagentColor = reagentColor;
}