Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uichange chemmaster #17

Open
wants to merge 3 commits into
base: release
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
more transfer rate options
DEATHB4DEFEAT committed Mar 24, 2023

Verified

This commit was signed with the committer’s verified signature.
theseion Max Leske
commit a7da0e6d8f4a9b67d37fb5d7cf3b73328260cdfb
12 changes: 6 additions & 6 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
MinSize="620 670"
Title="{Loc 'chem-master-bound-user-interface-title'}">
<TabContainer Name="Tabs" Margin="5 5 7 5">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5 5 5 5" SeparationOverride="10">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5" SeparationOverride="10">
<!-- Input container info -->
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-container-label'}" />
@@ -20,7 +20,7 @@

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

<ScrollContainer HorizontalExpand="True" MinSize="0 200">
<!-- Buffer reagent list -->
<BoxContainer Name="BufferInfo" Orientation="Vertical" Margin="4 4 4 4" HorizontalExpand="True">
<BoxContainer Name="BufferInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-buffer-empty-text'}" />
</BoxContainer>
</ScrollContainer>
</PanelContainer>
</BoxContainer>

<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5 5 5 5" SeparationOverride="10">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5" SeparationOverride="10">
<!-- Output container info -->
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-container-label'}" />
@@ -67,7 +67,7 @@

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

<!-- Packaging Info -->
<BoxContainer Orientation="Vertical" Margin="4 4 4 4" HorizontalExpand="True" VerticalExpand="True" SeparationOverride="5">
<BoxContainer Orientation="Vertical" Margin="4" HorizontalExpand="True" VerticalExpand="True" SeparationOverride="5">
<!-- Label for output -->
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-current-text-label'}" />
10 changes: 7 additions & 3 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -211,6 +211,8 @@ private void UpdatePanelInfo(ChemMasterBoundUserInterfaceState state)
MakeReagentButton("5", ChemMasterReagentAmount.U5, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
MakeReagentButton("10", ChemMasterReagentAmount.U10, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
MakeReagentButton("25", ChemMasterReagentAmount.U25, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
MakeReagentButton("50", ChemMasterReagentAmount.U50, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
MakeReagentButton("100", ChemMasterReagentAmount.U100, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
MakeReagentButton(Loc.GetString("chem-master-window-buffer-all-amount"), ChemMasterReagentAmount.All, reagent.ReagentId, true, StyleBase.ButtonOpenLeft),
}
});
@@ -255,10 +257,9 @@ private void BuildContainerUI(Control control, ContainerInfo? info, bool addReag
// Try to get the prototype for the given reagent. This gives us its name.
_prototypeManager.TryIndex(lineItem.Id, out ReagentPrototype? proto);
var name = proto?.LocalizedName
?? Loc.GetString("chem-master-window-unknown-reagent-text");
?? Loc.GetString("chem-master-window-unknown-reagent-text");

return (name, lineItem.Id, lineItem.Quantity);

})
.OrderBy(r => r.Item1);

@@ -293,6 +294,10 @@ private void BuildContainerUI(Control control, ContainerInfo? info, bool addReag
"10", ChemMasterReagentAmount.U10, id, false, StyleBase.ButtonOpenBoth));
cs.Add(MakeReagentButton(
"25", ChemMasterReagentAmount.U25, id, false, StyleBase.ButtonOpenBoth));
cs.Add(MakeReagentButton(
"50", ChemMasterReagentAmount.U50, id, false, StyleBase.ButtonOpenBoth));
cs.Add(MakeReagentButton(
"100", ChemMasterReagentAmount.U100, id, false, StyleBase.ButtonOpenBoth));
cs.Add(MakeReagentButton(
Loc.GetString("chem-master-window-buffer-all-amount"),
ChemMasterReagentAmount.All, id, false, StyleBase.ButtonOpenLeft));
@@ -330,6 +335,5 @@ public ReagentButton(string text, ChemMasterReagentAmount amount, string id, boo
Id = id;
IsBuffer = isBuffer;
}

}
}
4 changes: 0 additions & 4 deletions Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
using System.Linq;
using Content.Server.Chemistry.Components;
using Content.Server.Labels;
using Content.Server.Labels.Components;
using Content.Server.Popups;
using Content.Server.Storage.Components;
using Content.Server.Storage.EntitySystems;
@@ -16,9 +15,6 @@
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Robust.Shared.Utility;


namespace Content.Server.Chemistry.EntitySystems
{
2 changes: 2 additions & 0 deletions Content.Shared/Chemistry/SharedChemMaster.cs
Original file line number Diff line number Diff line change
@@ -95,6 +95,8 @@ public enum ChemMasterReagentAmount
U5 = 5,
U10 = 10,
U25 = 25,
U50 = 50,
U100 = 100,
All,
}