diff --git a/Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml b/Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml
new file mode 100644
index 0000000000..c859dc4350
--- /dev/null
+++ b/Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Content.Client/Chemistry/UI/ReagentDispenserWindow.cs b/Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml.cs
similarity index 55%
rename from Content.Client/Chemistry/UI/ReagentDispenserWindow.cs
rename to Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml.cs
index 34311fb74d..272f6e9c37 100644
--- a/Content.Client/Chemistry/UI/ReagentDispenserWindow.cs
+++ b/Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml.cs
@@ -3,14 +3,13 @@ using Content.Client.Stylesheets;
using Content.Client.UserInterface;
using Content.Shared.Chemistry.Dispenser;
using Content.Shared.Chemistry.Reagent;
-using Robust.Client.Graphics;
-using Robust.Client.UserInterface;
+using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
+using Robust.Client.UserInterface.XAML;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
-using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using static Content.Shared.Chemistry.Dispenser.SharedReagentDispenserComponent;
using static Robust.Client.UserInterface.Controls.BoxContainer;
@@ -20,133 +19,30 @@ namespace Content.Client.Chemistry.UI
///
/// Client-side UI used to control a
///
- public class ReagentDispenserWindow : SS14Window
+ [GenerateTypedNameReferences]
+ public partial class ReagentDispenserWindow : SS14Window
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
- /// Contains info about the reagent container such as it's contents, if one is loaded into the dispenser.
- private readonly BoxContainer ContainerInfo;
-
- /// Sets the dispense amount to 1 when pressed.
- public Button DispenseButton1 { get; }
-
- /// Sets the dispense amount to 5 when pressed.
- public Button DispenseButton5 { get; }
-
- /// Sets the dispense amount to 10 when pressed.
- public Button DispenseButton10 { get; }
-
- /// Sets the dispense amount to 15 when pressed.
- public Button DispenseButton15 { get; }
-
- /// Sets the dispense amount to 20 when pressed.
- public Button DispenseButton20 { get; }
-
- /// Sets the dispense amount to 25 when pressed.
- public Button DispenseButton25 { get; }
-
- /// Sets the dispense amount to 30 when pressed.
- public Button DispenseButton30 { get; }
-
- /// Sets the dispense amount to 50 when pressed.
- public Button DispenseButton50 { get; }
-
- /// Sets the dispense amount to 100 when pressed.
- public Button DispenseButton100 { get; }
-
- /// Ejects the reagent container from the dispenser.
- public Button ClearButton { get; }
-
- /// Removes all reagents from the reagent container.
- public Button EjectButton { get; }
-
- /// A grid of buttons for each reagent which can be dispensed.
- public GridContainer ChemicalList { get; }
-
///
/// Create and initialize the dispenser UI client-side. Creates the basic layout,
/// actual data isn't filled in until the server sends data about the dispenser.
///
public ReagentDispenserWindow()
{
- SetSize = MinSize = (590, 400);
+ RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
var dispenseAmountGroup = new ButtonGroup();
-
- Contents.AddChild(new BoxContainer
- {
- Orientation = LayoutOrientation.Vertical,
- Children =
- {
- //First, our dispense amount buttons
- new BoxContainer
- {
- Orientation = LayoutOrientation.Horizontal,
- Children =
- {
- new Label {Text = Loc.GetString("reagent-dispenser-window-amount-to-dispense-label")},
- //Padding
- new Control {MinSize = (20, 0)},
- (DispenseButton1 = new Button {Text = "1", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenRight }}),
- (DispenseButton5 = new Button {Text = "5", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
- (DispenseButton10 = new Button {Text = "10", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
- (DispenseButton15 = new Button {Text = "15", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
- (DispenseButton20 = new Button {Text = "20", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
- (DispenseButton25 = new Button {Text = "25", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
- (DispenseButton30 = new Button {Text = "30", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
- (DispenseButton50 = new Button {Text = "50", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
- (DispenseButton100 = new Button {Text = "100", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenLeft }}),
- }
- },
- //Padding
- new Control {MinSize = (0.0f, 10.0f)},
- //Grid of which reagents can be dispensed.
- (ChemicalList = new GridContainer
- {
- Columns = 5
- }),
- //Padding
- new Control {MinSize = (0.0f, 10.0f)},
- new BoxContainer
- {
- Orientation = LayoutOrientation.Horizontal,
- Children =
- {
- new Label {Text = Loc.GetString("reagent-dispenser-window-container-label") + " "},
- (ClearButton = new Button {Text = Loc.GetString("reagent-dispenser-window-clear-button"), StyleClasses = {StyleBase.ButtonOpenRight}}),
- (EjectButton = new Button {Text = Loc.GetString("reagent-dispenser-window-eject-button"), StyleClasses = {StyleBase.ButtonOpenLeft}})
- }
- },
- //Wrap the container info in a PanelContainer so we can color it's background differently.
- new PanelContainer
- {
- VerticalExpand = true,
- SizeFlagsStretchRatio = 6,
- MinSize = (0, 150),
- PanelOverride = new StyleBoxFlat
- {
- BackgroundColor = new Color(27, 27, 30)
- },
- Children =
- {
- //Currently empty, when server sends state data this will have container contents and fill volume.
- (ContainerInfo = new BoxContainer
- {
- Orientation = LayoutOrientation.Vertical,
- HorizontalExpand = true,
- Children =
- {
- new Label
- {
- Text = Loc.GetString("reagent-dispenser-window-no-container-loaded-text")
- }
- }
- }),
- }
- },
- }
- });
+ DispenseButton1.Group = dispenseAmountGroup;
+ DispenseButton5.Group = dispenseAmountGroup;
+ DispenseButton10.Group = dispenseAmountGroup;
+ DispenseButton15.Group = dispenseAmountGroup;
+ DispenseButton20.Group = dispenseAmountGroup;
+ DispenseButton25.Group = dispenseAmountGroup;
+ DispenseButton30.Group = dispenseAmountGroup;
+ DispenseButton50.Group = dispenseAmountGroup;
+ DispenseButton10.Group = dispenseAmountGroup;
}
///