Remove encapsulation for previously protected XAML UI fields (#4975)

This commit is contained in:
Visne
2021-10-28 14:23:17 +02:00
committed by GitHub
parent aed66cfc48
commit ac78145b94
49 changed files with 158 additions and 202 deletions

View File

@@ -2,7 +2,7 @@
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
SetSize="400 600"
MinSize="400 600">
<BoxContainer Orientation="Vertical" Name="rows"> <!-- TODO: remove name -->
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'cargo-console-menu-account-name-label'}"
StyleClasses="LabelKeyText" />
@@ -28,7 +28,8 @@
Text="0/20" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Button Name="CallShuttleButtonProtected"
<Button Name="CallShuttleButton"
Access="Public"
Text="{Loc 'cargo-console-menu-call-shuttle-button'}"
TextAlign="Center"
HorizontalExpand="True"/>

View File

@@ -25,8 +25,6 @@ namespace Content.Client.Cargo.UI
public event Action<ButtonEventArgs>? OnOrderApproved;
public event Action<ButtonEventArgs>? OnOrderCanceled;
public Button CallShuttleButton => CallShuttleButtonProtected;
private readonly List<string> _categoryStrings = new();
private string? _category;

View File

@@ -3,15 +3,19 @@
<BoxContainer Orientation="Vertical">
<GridContainer Columns="2">
<Label Text="{Loc 'cargo-console-order-menu-requester-label'}" />
<LineEdit Name="RequesterProtected" />
<LineEdit Name="Requester"
Access="Public" />
<Label Text="{Loc 'cargo-console-order-menu-reason-label'}" />
<LineEdit Name="ReasonProtected" />
<LineEdit Name="Reason"
Access="Public" />
<Label Text="{Loc 'cargo-console-order-menu-amount-label'}" />
<SpinBox Name="AmountProtected"
<SpinBox Name="Amount"
Access="Public"
HorizontalExpand="True"
Value="1" />
</GridContainer>
<Button Name="SubmitButtonProtected"
<Button Name="SubmitButton"
Access="Public"
Text="{Loc 'cargo-console-order-menu-submit-button'}"
TextAlign="Center" />
</BoxContainer>

View File

@@ -10,11 +10,6 @@ namespace Content.Client.Cargo.UI
[GenerateTypedNameReferences]
partial class CargoConsoleOrderMenu : SS14Window
{
public LineEdit Requester => RequesterProtected;
public LineEdit Reason => ReasonProtected;
public SpinBox Amount => AmountProtected;
public Button SubmitButton => SubmitButtonProtected;
public CargoConsoleOrderMenu()
{
RobustXamlLoader.Load(this);

View File

@@ -2,25 +2,30 @@
HorizontalExpand="True">
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True">
<TextureRect Name="IconProtected"
<TextureRect Name="Icon"
Access="Public"
MinSize="32 32"
RectClipContent="True" />
<BoxContainer Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True">
<Label Name="ProductNameProtected"
<Label Name="ProductName"
Access="Public"
HorizontalExpand="True"
StyleClasses="LabelSubText"
ClipText="True" />
<Label Name="DescriptionProtected"
<Label Name="Description"
Access="Public"
HorizontalExpand="True"
StyleClasses="LabelSubText"
ClipText="True" />
</BoxContainer>
<Button Name="ApproveProtected"
<Button Name="Approve"
Access="Public"
Text="{Loc 'cargo-console-menu-cargo-order-row-approve-button'}"
StyleClasses="LabelSubText" />
<Button Name="CancelProtected"
<Button Name="Cancel"
Access="Public"
Text="{Loc 'cargo-console-menu-cargo-order-row-cancel-button'}"
StyleClasses="LabelSubText" />
</BoxContainer>

View File

@@ -9,11 +9,6 @@ namespace Content.Client.Cargo.UI
public partial class CargoOrderRow : PanelContainer
{
public CargoOrderData? Order { get; set; }
public TextureRect Icon => IconProtected;
public Label ProductName => ProductNameProtected;
public Label Description => DescriptionProtected;
public Button Approve => ApproveProtected;
public Button Cancel => CancelProtected;
public CargoOrderRow()
{

View File

@@ -1,21 +1,25 @@
<PanelContainer xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
HorizontalExpand="True">
<Button Name="MainButtonProtected"
<Button Name="MainButton"
Access="Public"
HorizontalExpand="True"
VerticalExpand="True" />
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True">
<TextureRect Name="IconProtected"
<TextureRect Name="Icon"
Access="Public"
MinSize="32 32"
RectClipContent="True" />
<Label Name="ProductNameProtected"
<Label Name="ProductName"
Access="Public"
HorizontalExpand="True" />
<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#25252A" />
</PanelContainer.PanelOverride>
<Label Name="PointCostProtected"
<Label Name="PointCost"
Access="Public"
MinSize="40 32"
Align="Right" />
</PanelContainer>

View File

@@ -9,10 +9,6 @@ namespace Content.Client.Cargo.UI
public partial class CargoProductRow : PanelContainer
{
public CargoProductPrototype? Product { get; set; }
public TextureRect Icon => IconProtected;
public Button MainButton => MainButtonProtected;
public Label ProductName => ProductNameProtected;
public Label PointCost => PointCostProtected;
public CargoProductRow()
{