Replace most VBox/HBoxContainers with BoxContainers (#4274)

This commit is contained in:
Visne
2021-07-18 18:39:31 +02:00
committed by GitHub
parent 0d1af2c5ff
commit bf493c39b7
101 changed files with 1143 additions and 567 deletions

View File

@@ -12,6 +12,7 @@ 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;
namespace Content.Client.Chemistry.UI
{
@@ -23,7 +24,7 @@ namespace Content.Client.Chemistry.UI
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
/// <summary>Contains info about the reagent container such as it's contents, if one is loaded into the dispenser.</summary>
private readonly VBoxContainer ContainerInfo;
private readonly BoxContainer ContainerInfo;
/// <summary>Sets the dispense amount to 1 when pressed.</summary>
public Button DispenseButton1 { get; }
@@ -72,13 +73,15 @@ namespace Content.Client.Chemistry.UI
var dispenseAmountGroup = new ButtonGroup();
Contents.AddChild(new VBoxContainer
Contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
//First, our dispense amount buttons
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label {Text = Loc.GetString("reagent-dispenser-window-amount-to-dispense-label")},
@@ -104,8 +107,9 @@ namespace Content.Client.Chemistry.UI
}),
//Padding
new Control {MinSize = (0.0f, 10.0f)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label {Text = Loc.GetString("reagent-dispenser-window-container-label") + " "},
@@ -126,8 +130,9 @@ namespace Content.Client.Chemistry.UI
Children =
{
//Currently empty, when server sends state data this will have container contents and fill volume.
(ContainerInfo = new VBoxContainer
(ContainerInfo = new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
HorizontalExpand = true,
Children =
{
@@ -263,8 +268,9 @@ namespace Content.Client.Chemistry.UI
return;
}
ContainerInfo.Children.Add(new HBoxContainer // Name of the container and its fill status (Ex: 44/100u)
ContainerInfo.Children.Add(new BoxContainer // Name of the container and its fill status (Ex: 44/100u)
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label {Text = $"{state.ContainerName}: "},
@@ -293,8 +299,9 @@ namespace Content.Client.Chemistry.UI
//Check if the reagent is being moused over. If so, color it green.
if (proto != null && proto.ID == highlightedReagentId)
{
ContainerInfo.Children.Add(new HBoxContainer
ContainerInfo.Children.Add(new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label
@@ -312,8 +319,9 @@ namespace Content.Client.Chemistry.UI
}
else //Otherwise, color it the normal colors.
{
ContainerInfo.Children.Add(new HBoxContainer
ContainerInfo.Children.Add(new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label {Text = $"{name}: "},