Skip to content

Commit

Permalink
Make ChemMaster wider, add 20, 75, and 80 units options
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyyapril committed Jan 7, 2025
1 parent 96164d8 commit 81e8e1b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
MinSize="620 670"
MinSize="620 770"
Title="{Loc 'chem-master-bound-user-interface-title'}">
<TabContainer Name="Tabs" Margin="5 5 7 5">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5" SeparationOverride="10">
Expand All @@ -13,12 +13,12 @@
<Button MinSize="80 0" Name="InputEjectButton" Access="Public" Text="{Loc 'chem-master-window-eject-button'}" />
</BoxContainer>

<PanelContainer VerticalExpand="True" MinSize="0 200">
<PanelContainer VerticalExpand="True" MinSize="0 300">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>

<ScrollContainer HorizontalExpand="True" MinSize="0 200">
<ScrollContainer HorizontalExpand="True" MinSize="0 300">
<!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
<BoxContainer Name="InputContainerInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
Expand All @@ -38,12 +38,12 @@
</BoxContainer>

<!-- Buffer info -->
<PanelContainer VerticalExpand="True" MinSize="0 200">
<PanelContainer VerticalExpand="True" MinSize="0 300">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>

<ScrollContainer HorizontalExpand="True" MinSize="0 200">
<ScrollContainer HorizontalExpand="True" MinSize="0 300">
<!-- Buffer reagent list -->
<BoxContainer Name="BufferInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-buffer-empty-text'}" />
Expand All @@ -60,12 +60,12 @@
<Button MinSize="80 0" Name="OutputEjectButton" Access="Public" Text="{Loc 'chem-master-window-eject-button'}" />
</BoxContainer>

<PanelContainer VerticalExpand="True" MinSize="0 200">
<PanelContainer VerticalExpand="True" MinSize="0 300">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>

<ScrollContainer HorizontalExpand="True" MinSize="0 200">
<ScrollContainer HorizontalExpand="True" MinSize="0 300">
<!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
<BoxContainer Name="OutputContainerInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
Expand Down Expand Up @@ -129,4 +129,4 @@
</PanelContainer>
</BoxContainer>
</TabContainer>
</controls:FancyWindow>
</controls:FancyWindow>
5 changes: 3 additions & 2 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,16 @@ private ReagentButton MakeReagentButton(string text, ChemMasterReagentAmount amo
private List<ReagentButton> CreateReagentTransferButtons(ReagentId reagent, bool isBuffer, bool addReagentButtons)
{
if (!addReagentButtons)
return new List<ReagentButton>(); // Return an empty list if reagentTransferButton creation is disabled.
return new(); // Return an empty list if reagentTransferButton creation is disabled.

var buttons = new List<ReagentButton>();
var names = Enum.GetNames<ChemMasterReagentAmount>();
var values = Enum.GetValues<ChemMasterReagentAmount>();

for (int i = 0; i < names.Length; i++)
{
var name = names[i];
var isNumber = int.TryParse(names[i].Substring(1), out int number);
var name = isNumber ? number.ToString() : names[i];
var reagentAmount = values[i];

var reagentTransferButton = MakeReagentButton(
Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/Chemistry/SharedChemMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,13 @@ public enum ChemMasterReagentAmount
U5 = 5,
U10 = 10,
U15 = 15,
U20 = 20,
U25 = 25,
U30 = 30,
U45 = 45,
U50 = 50,
U75 = 75,
U90 = 90,
U100 = 100,
All,
}
Expand Down

0 comments on commit 81e8e1b

Please sign in to comment.