Skip to content

Commit

Permalink
Merge pull request #1661 from space-syndicate/upstream-sync
Browse files Browse the repository at this point in the history
Upstream sync
  • Loading branch information
Morb0 authored Dec 21, 2023
2 parents 75c2e07 + 972d3f4 commit 5b82eaa
Show file tree
Hide file tree
Showing 280 changed files with 43,260 additions and 35,350 deletions.
34 changes: 30 additions & 4 deletions Content.Client/Atmos/UI/GasAnalyzerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ private void GenerateGasDisplay(GasMixEntry gasMix, Control parent)
{
Orientation = BoxContainer.LayoutOrientation.Vertical
};
var tablePercent = new BoxContainer
{
Orientation = BoxContainer.LayoutOrientation.Vertical
};
dataContainer.AddChild(new BoxContainer
{
Orientation = BoxContainer.LayoutOrientation.Horizontal,
Expand All @@ -252,14 +256,21 @@ private void GenerateGasDisplay(GasMixEntry gasMix, Control parent)
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
var height = 30;
var gasBar = new SplitBar
{
MinHeight = height,
MinBarSize = new Vector2(12, 0)
};
// Separator
dataContainer.AddChild(new Control
Expand All @@ -274,6 +285,17 @@ private void GenerateGasDisplay(GasMixEntry gasMix, Control parent)
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];
Expand All @@ -286,10 +308,14 @@ private void GenerateGasDisplay(GasMixEntry gasMix, Control parent)
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
Expand Down
Loading

0 comments on commit 5b82eaa

Please sign in to comment.