Improve gas analyzer interface (#22779)
This commit is contained in:
@@ -241,6 +241,10 @@ namespace Content.Client.Atmos.UI
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical
|
||||
};
|
||||
var tablePercent = new BoxContainer
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical
|
||||
};
|
||||
dataContainer.AddChild(new BoxContainer
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Horizontal,
|
||||
@@ -252,7 +256,13 @@ namespace Content.Client.Atmos.UI
|
||||
MinSize = new Vector2(10, 0),
|
||||
HorizontalExpand = true
|
||||
},
|
||||
tableVal
|
||||
tableVal,
|
||||
new Control
|
||||
{
|
||||
MinSize = new Vector2(10, 0),
|
||||
HorizontalExpand = true
|
||||
},
|
||||
tablePercent
|
||||
}
|
||||
});
|
||||
// This is the gas bar thingy
|
||||
@@ -260,6 +270,7 @@ namespace Content.Client.Atmos.UI
|
||||
var gasBar = new SplitBar
|
||||
{
|
||||
MinHeight = height,
|
||||
MinBarSize = new Vector2(12, 0)
|
||||
};
|
||||
// Separator
|
||||
dataContainer.AddChild(new Control
|
||||
@@ -274,6 +285,17 @@ namespace Content.Client.Atmos.UI
|
||||
totalGasAmount += gas.Amount;
|
||||
}
|
||||
|
||||
tableKey.AddChild(new Label
|
||||
{ Text = Loc.GetString("gas-analyzer-window-gas-column-name"), Align = Label.AlignMode.Center });
|
||||
tableVal.AddChild(new Label
|
||||
{ Text = Loc.GetString("gas-analyzer-window-molarity-column-name"), Align = Label.AlignMode.Center });
|
||||
tablePercent.AddChild(new Label
|
||||
{ Text = Loc.GetString("gas-analyzer-window-percentage-column-name"), Align = Label.AlignMode.Center });
|
||||
|
||||
tableKey.AddChild(new StripeBack());
|
||||
tableVal.AddChild(new StripeBack());
|
||||
tablePercent.AddChild(new StripeBack());
|
||||
|
||||
for (var j = 0; j < gasMix.Gases.Length; j++)
|
||||
{
|
||||
var gas = gasMix.Gases[j];
|
||||
@@ -286,10 +308,14 @@ namespace Content.Client.Atmos.UI
|
||||
tableVal.AddChild(new Label
|
||||
{
|
||||
Text = Loc.GetString("gas-analyzer-window-molarity-text",
|
||||
("mol", $"{gas.Amount:0.##}"),
|
||||
("percentage", $"{(gas.Amount / totalGasAmount * 100):0.#}")),
|
||||
("mol", $"{gas.Amount:0.00}")),
|
||||
Align = Label.AlignMode.Right,
|
||||
HorizontalExpand = true
|
||||
});
|
||||
tablePercent.AddChild(new Label
|
||||
{
|
||||
Text = Loc.GetString("gas-analyzer-window-percentage-text",
|
||||
("percentage", $"{(gas.Amount / totalGasAmount * 100):0.0}")),
|
||||
Align = Label.AlignMode.Right
|
||||
});
|
||||
|
||||
// Add to the gas bar //TODO: highlight the currently hover one
|
||||
|
||||
Reference in New Issue
Block a user