uichange Chemmaster (#14237)
This commit is contained in:
@@ -1,88 +1,81 @@
|
|||||||
<DefaultWindow xmlns="https://spacestation14.io"
|
<controls:FancyWindow xmlns="https://spacestation14.io"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
MinSize="620 670"
|
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
|
||||||
Title="{Loc 'chem-master-bound-user-interface-title'}">
|
MinSize="620 670"
|
||||||
<TabContainer Name="Tabs" Margin="0 0 2 0">
|
Title="{Loc 'chem-master-bound-user-interface-title'}">
|
||||||
<BoxContainer Orientation="Vertical"
|
<TabContainer Name="Tabs" Margin="5 5 7 5">
|
||||||
HorizontalExpand="True"
|
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5" SeparationOverride="10">
|
||||||
Margin="5 5 5 5"
|
|
||||||
SeparationOverride="10">
|
|
||||||
<!-- Input container info -->
|
<!-- Input container info -->
|
||||||
<BoxContainer Orientation="Horizontal">
|
<BoxContainer Orientation="Horizontal">
|
||||||
<Label Text="{Loc 'chem-master-window-container-label'}" />
|
<Label Text="{Loc 'chem-master-window-container-label'}" />
|
||||||
<Control HorizontalExpand="True" />
|
<Control HorizontalExpand="True" />
|
||||||
<Button Name="InputEjectButton"
|
<Button MinSize="80 0" Name="InputEjectButton" Access="Public" Text="{Loc 'chem-master-window-eject-button'}" />
|
||||||
Access="Public"
|
|
||||||
Text="{Loc 'chem-master-window-eject-button'}" />
|
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|
||||||
<PanelContainer VerticalExpand="True" MinSize="0 200">
|
<PanelContainer VerticalExpand="True" MinSize="0 200">
|
||||||
<PanelContainer.PanelOverride>
|
<PanelContainer.PanelOverride>
|
||||||
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
|
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
|
||||||
</PanelContainer.PanelOverride>
|
</PanelContainer.PanelOverride>
|
||||||
<!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
|
|
||||||
<BoxContainer Name="InputContainerInfo"
|
<ScrollContainer HorizontalExpand="True" MinSize="0 200">
|
||||||
Orientation="Vertical"
|
<!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
|
||||||
Margin="4 4 4 4"
|
<BoxContainer Name="InputContainerInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
|
||||||
HorizontalExpand="True">
|
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
|
||||||
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
|
</BoxContainer>
|
||||||
</BoxContainer>
|
</ScrollContainer>
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
|
|
||||||
<!-- Padding -->
|
<!-- Padding -->
|
||||||
<Control MinSize="0 10" />
|
<Control MinSize="0 10" />
|
||||||
|
|
||||||
<!-- Buffer -->
|
<!-- Buffer -->
|
||||||
<BoxContainer Orientation="Horizontal">
|
<BoxContainer Orientation="Horizontal">
|
||||||
<Label Text="{Loc 'chem-master-window-buffer-text'}" />
|
<Label Text="{Loc 'chem-master-window-buffer-text'}" />
|
||||||
<Control HorizontalExpand="True" />
|
<Control HorizontalExpand="True" />
|
||||||
<Button Name="BufferTransferButton"
|
<Button MinSize="80 0" Name="BufferTransferButton" Access="Public" Text="{Loc 'chem-master-window-transfer-button'}" ToggleMode="True" StyleClasses="OpenRight" />
|
||||||
Access="Public"
|
<Button MinSize="80 0" Name="BufferDiscardButton" Access="Public" Text="{Loc 'chem-master-window-discard-button'}" ToggleMode="True" StyleClasses="OpenLeft" />
|
||||||
Text="{Loc 'chem-master-window-transfer-button'}" ToggleMode="True"
|
|
||||||
StyleClasses="OpenRight" />
|
|
||||||
<Button Name="BufferDiscardButton"
|
|
||||||
Access="Public"
|
|
||||||
Text="{Loc 'chem-master-window-discard-button'}" ToggleMode="True"
|
|
||||||
StyleClasses="OpenLeft" />
|
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|
||||||
<!-- Buffer info -->
|
<!-- Buffer info -->
|
||||||
<PanelContainer VerticalExpand="True" MinSize="0 200">
|
<PanelContainer VerticalExpand="True" MinSize="0 200">
|
||||||
<PanelContainer.PanelOverride>
|
<PanelContainer.PanelOverride>
|
||||||
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
|
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
|
||||||
</PanelContainer.PanelOverride>
|
</PanelContainer.PanelOverride>
|
||||||
<!-- Buffer reagent list -->
|
|
||||||
<BoxContainer Name="BufferInfo"
|
<ScrollContainer HorizontalExpand="True" MinSize="0 200">
|
||||||
Orientation="Vertical"
|
<!-- Buffer reagent list -->
|
||||||
Margin="4 4 4 4"
|
<BoxContainer Name="BufferInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
|
||||||
HorizontalExpand="True">
|
<Label Text="{Loc 'chem-master-window-buffer-empty-text'}" />
|
||||||
<Label Text="{Loc 'chem-master-window-buffer-empty-text'}" />
|
</BoxContainer>
|
||||||
</BoxContainer>
|
</ScrollContainer>
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
<BoxContainer Orientation="Vertical"
|
|
||||||
HorizontalExpand="True"
|
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5" SeparationOverride="10">
|
||||||
Margin="5 5 5 5"
|
|
||||||
SeparationOverride="10">
|
|
||||||
<!-- Output container info -->
|
<!-- Output container info -->
|
||||||
<BoxContainer Orientation="Horizontal">
|
<BoxContainer Orientation="Horizontal">
|
||||||
<Label Text="{Loc 'chem-master-window-container-label'}" />
|
<Label Text="{Loc 'chem-master-window-container-label'}" />
|
||||||
<Control HorizontalExpand="True" />
|
<Control HorizontalExpand="True" />
|
||||||
<Button Name="OutputEjectButton"
|
<Button MinSize="80 0" Name="OutputEjectButton" Access="Public" Text="{Loc 'chem-master-window-eject-button'}" />
|
||||||
Access="Public"
|
|
||||||
Text="{Loc 'chem-master-window-eject-button'}" />
|
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|
||||||
<PanelContainer VerticalExpand="True" MinSize="0 200">
|
<PanelContainer VerticalExpand="True" MinSize="0 200">
|
||||||
<PanelContainer.PanelOverride>
|
<PanelContainer.PanelOverride>
|
||||||
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
|
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
|
||||||
</PanelContainer.PanelOverride>
|
</PanelContainer.PanelOverride>
|
||||||
<!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
|
|
||||||
<BoxContainer Name="OutputContainerInfo"
|
<ScrollContainer HorizontalExpand="True" MinSize="0 200">
|
||||||
Orientation="Vertical"
|
<!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
|
||||||
Margin="4 4 4 4"
|
<BoxContainer Name="OutputContainerInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
|
||||||
HorizontalExpand="True">
|
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
|
||||||
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
|
</BoxContainer>
|
||||||
</BoxContainer>
|
</ScrollContainer>
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
|
|
||||||
<!-- Padding -->
|
<!-- Padding -->
|
||||||
<Control MinSize="0 10" />
|
<Control MinSize="0 10" />
|
||||||
|
|
||||||
<!-- Packaging -->
|
<!-- Packaging -->
|
||||||
<BoxContainer Orientation="Horizontal">
|
<BoxContainer Orientation="Horizontal">
|
||||||
<Label Text="{Loc 'chem-master-window-packaging-text'}" />
|
<Label Text="{Loc 'chem-master-window-packaging-text'}" />
|
||||||
@@ -90,23 +83,22 @@
|
|||||||
<Label Text="{Loc 'chem-master-window-buffer-label'}" />
|
<Label Text="{Loc 'chem-master-window-buffer-label'}" />
|
||||||
<Label Name="BufferCurrentVolume" StyleClasses="LabelSecondaryColor" />
|
<Label Name="BufferCurrentVolume" StyleClasses="LabelSecondaryColor" />
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|
||||||
<!-- Wrap the packaging info-->
|
<!-- Wrap the packaging info-->
|
||||||
<PanelContainer>
|
<PanelContainer>
|
||||||
<PanelContainer.PanelOverride>
|
<PanelContainer.PanelOverride>
|
||||||
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
|
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
|
||||||
</PanelContainer.PanelOverride>
|
</PanelContainer.PanelOverride>
|
||||||
|
|
||||||
<!-- Packaging Info -->
|
<!-- Packaging Info -->
|
||||||
<BoxContainer Orientation="Vertical"
|
<BoxContainer Orientation="Vertical" Margin="4" HorizontalExpand="True" VerticalExpand="True" SeparationOverride="5">
|
||||||
Margin="4 4 4 4"
|
|
||||||
HorizontalExpand="True"
|
|
||||||
VerticalExpand="True"
|
|
||||||
SeparationOverride="5">
|
|
||||||
<!-- Label for output -->
|
<!-- Label for output -->
|
||||||
<BoxContainer Orientation="Horizontal">
|
<BoxContainer Orientation="Horizontal">
|
||||||
<Label Text="{Loc 'chem-master-current-text-label'}" />
|
<Label Text="{Loc 'chem-master-current-text-label'}" />
|
||||||
<Control HorizontalExpand="True" MinSize="50 0"/>
|
<Control HorizontalExpand="True" MinSize="50 0"/>
|
||||||
<LineEdit Name="LabelLineEdit" SetWidth="455"/>
|
<LineEdit Name="LabelLineEdit" SetWidth="455"/>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|
||||||
<!-- Pills Type Buttons -->
|
<!-- Pills Type Buttons -->
|
||||||
<BoxContainer Orientation="Horizontal">
|
<BoxContainer Orientation="Horizontal">
|
||||||
<Label Text="{Loc 'chem-master-window-pill-type-label'}"/>
|
<Label Text="{Loc 'chem-master-window-pill-type-label'}"/>
|
||||||
@@ -115,42 +107,26 @@
|
|||||||
<!-- Pills type buttons are generated in the code -->
|
<!-- Pills type buttons are generated in the code -->
|
||||||
</GridContainer>
|
</GridContainer>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|
||||||
<BoxContainer Orientation="Horizontal">
|
<BoxContainer Orientation="Horizontal">
|
||||||
<Label Text="{Loc 'chem-master-window-pills-label'}" />
|
<Label Text="{Loc 'chem-master-window-pills-label'}" />
|
||||||
<Control HorizontalExpand="True"
|
<Control HorizontalExpand="True" MinSize="50 0" />
|
||||||
MinSize="50 0" />
|
<Label Text="{Loc 'chem-master-window-pills-number-label'}" Margin="5 0 0 0" StyleClasses="LabelSecondaryColor" />
|
||||||
<Label Text="{Loc 'chem-master-window-pills-number-label'}"
|
<SpinBox MinSize="100 0" Name="PillNumber" Access="Public" Value="0" />
|
||||||
Margin="5 0 0 0"
|
<Label Text="{Loc 'chem-master-window-dose-label'}" Margin="5 0 0 0" StyleClasses="LabelSecondaryColor" />
|
||||||
StyleClasses="LabelSecondaryColor" />
|
<SpinBox MinSize="100 0" Name="PillDosage" Access="Public" Value="1" />
|
||||||
<SpinBox Name="PillNumber"
|
<Button MinSize="80 0" Name="CreatePillButton" Access="Public" Text="{Loc 'chem-master-window-create-button'}" />
|
||||||
Access="Public"
|
|
||||||
Value="0" />
|
|
||||||
<Label Text="{Loc 'chem-master-window-dose-label'}"
|
|
||||||
Margin="5 0 0 0"
|
|
||||||
StyleClasses="LabelSecondaryColor" />
|
|
||||||
<SpinBox Name="PillDosage"
|
|
||||||
Access="Public"
|
|
||||||
Value="1" />
|
|
||||||
<Button Name="CreatePillButton"
|
|
||||||
Access="Public"
|
|
||||||
Text="{Loc 'chem-master-window-create-button'}" />
|
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|
||||||
<BoxContainer Orientation="Horizontal">
|
<BoxContainer Orientation="Horizontal">
|
||||||
<Label Text="{Loc 'chem-master-window-bottles-label'}" />
|
<Label Text="{Loc 'chem-master-window-bottles-label'}" />
|
||||||
<Control HorizontalExpand="True"
|
<Control HorizontalExpand="True" MinSize="50 0" />
|
||||||
MinSize="50 0" />
|
<Label Text="{Loc 'chem-master-window-dose-label'}" Margin="5 0 0 0" StyleClasses="LabelSecondaryColor" />
|
||||||
<Label Text="{Loc 'chem-master-window-dose-label'}"
|
<SpinBox MinSize="100 0" Name="BottleDosage" Access="Public" Value="0" />
|
||||||
Margin="5 0 0 0"
|
<Button MinSize="80 0" Name="CreateBottleButton" Access="Public" Text="{Loc 'chem-master-window-create-button'}" />
|
||||||
StyleClasses="LabelSecondaryColor" />
|
|
||||||
<SpinBox Name="BottleDosage"
|
|
||||||
Access="Public"
|
|
||||||
Value="0" />
|
|
||||||
<Button Name="CreateBottleButton"
|
|
||||||
Access="Public"
|
|
||||||
Text="{Loc 'chem-master-window-create-button'}" />
|
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</TabContainer>
|
</TabContainer>
|
||||||
</DefaultWindow>
|
</controls:FancyWindow>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Client.Stylesheets;
|
using Content.Client.Stylesheets;
|
||||||
|
using Content.Client.UserInterface.Controls;
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.Chemistry.Reagent;
|
using Content.Shared.Chemistry.Reagent;
|
||||||
using Robust.Client.AutoGenerated;
|
using Robust.Client.AutoGenerated;
|
||||||
@@ -18,7 +19,7 @@ namespace Content.Client.Chemistry.UI
|
|||||||
/// Client-side UI used to control a <see cref="SharedChemMasterComponent"/>
|
/// Client-side UI used to control a <see cref="SharedChemMasterComponent"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[GenerateTypedNameReferences]
|
[GenerateTypedNameReferences]
|
||||||
public sealed partial class ChemMasterWindow : DefaultWindow
|
public sealed partial class ChemMasterWindow : FancyWindow
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
public event Action<BaseButton.ButtonEventArgs, ReagentButton>? OnReagentButtonPressed;
|
public event Action<BaseButton.ButtonEventArgs, ReagentButton>? OnReagentButtonPressed;
|
||||||
@@ -210,6 +211,8 @@ namespace Content.Client.Chemistry.UI
|
|||||||
MakeReagentButton("5", ChemMasterReagentAmount.U5, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
|
MakeReagentButton("5", ChemMasterReagentAmount.U5, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
|
||||||
MakeReagentButton("10", ChemMasterReagentAmount.U10, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
|
MakeReagentButton("10", ChemMasterReagentAmount.U10, reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
|
||||||
MakeReagentButton("25", ChemMasterReagentAmount.U25, 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),
|
MakeReagentButton(Loc.GetString("chem-master-window-buffer-all-amount"), ChemMasterReagentAmount.All, reagent.ReagentId, true, StyleBase.ButtonOpenLeft),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -254,10 +257,9 @@ namespace Content.Client.Chemistry.UI
|
|||||||
// Try to get the prototype for the given reagent. This gives us its name.
|
// Try to get the prototype for the given reagent. This gives us its name.
|
||||||
_prototypeManager.TryIndex(lineItem.Id, out ReagentPrototype? proto);
|
_prototypeManager.TryIndex(lineItem.Id, out ReagentPrototype? proto);
|
||||||
var name = proto?.LocalizedName
|
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);
|
return (name, lineItem.Id, lineItem.Quantity);
|
||||||
|
|
||||||
})
|
})
|
||||||
.OrderBy(r => r.Item1);
|
.OrderBy(r => r.Item1);
|
||||||
|
|
||||||
@@ -292,6 +294,10 @@ namespace Content.Client.Chemistry.UI
|
|||||||
"10", ChemMasterReagentAmount.U10, id, false, StyleBase.ButtonOpenBoth));
|
"10", ChemMasterReagentAmount.U10, id, false, StyleBase.ButtonOpenBoth));
|
||||||
cs.Add(MakeReagentButton(
|
cs.Add(MakeReagentButton(
|
||||||
"25", ChemMasterReagentAmount.U25, id, false, StyleBase.ButtonOpenBoth));
|
"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(
|
cs.Add(MakeReagentButton(
|
||||||
Loc.GetString("chem-master-window-buffer-all-amount"),
|
Loc.GetString("chem-master-window-buffer-all-amount"),
|
||||||
ChemMasterReagentAmount.All, id, false, StyleBase.ButtonOpenLeft));
|
ChemMasterReagentAmount.All, id, false, StyleBase.ButtonOpenLeft));
|
||||||
@@ -329,6 +335,5 @@ namespace Content.Client.Chemistry.UI
|
|||||||
Id = id;
|
Id = id;
|
||||||
IsBuffer = isBuffer;
|
IsBuffer = isBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Chemistry.Components;
|
using Content.Server.Chemistry.Components;
|
||||||
using Content.Server.Labels;
|
using Content.Server.Labels;
|
||||||
using Content.Server.Labels.Components;
|
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.Storage.Components;
|
using Content.Server.Storage.Components;
|
||||||
using Content.Server.Storage.EntitySystems;
|
using Content.Server.Storage.EntitySystems;
|
||||||
@@ -16,9 +15,6 @@ using JetBrains.Annotations;
|
|||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Utility;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Content.Server.Chemistry.EntitySystems
|
namespace Content.Server.Chemistry.EntitySystems
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ namespace Content.Shared.Chemistry
|
|||||||
U5 = 5,
|
U5 = 5,
|
||||||
U10 = 10,
|
U10 = 10,
|
||||||
U25 = 25,
|
U25 = 25,
|
||||||
|
U50 = 50,
|
||||||
|
U100 = 100,
|
||||||
All,
|
All,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user