forked from new-frontiers-14/frontier-station-14
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from Corvax-Frontier/up091124
Up091124
- Loading branch information
Showing
196 changed files
with
6,450 additions
and
7,434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
Content.Client/_NF/ShuttleRecords/BUI/ShuttleRecordsConsoleBoundUserInterface.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using Content.Client._NF.ShuttleRecords.UI; | ||
using Content.Shared._NF.ShuttleRecords; | ||
using Content.Shared._NF.ShuttleRecords.Components; | ||
using Content.Shared._NF.ShuttleRecords.Events; | ||
using Content.Shared.Containers.ItemSlots; | ||
|
||
namespace Content.Client._NF.ShuttleRecords.BUI; | ||
|
||
public sealed class ShuttleRecordsConsoleBoundUserInterface( | ||
EntityUid owner, | ||
Enum uiKey | ||
) : BoundUserInterface(owner, uiKey) | ||
{ | ||
private ShuttleRecordsWindow? _window; | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
_window ??= new ShuttleRecordsWindow(); | ||
_window.OnCopyDeed += CopyDeed; | ||
_window.TargetIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(ShuttleRecordsConsoleComponent.TargetIdCardSlotId)); | ||
|
||
_window.OpenCentered(); | ||
} | ||
|
||
protected override void UpdateState(BoundUserInterfaceState state) | ||
{ | ||
base.UpdateState(state); | ||
|
||
if (_window == null || state is not ShuttleRecordsConsoleInterfaceState shuttleRecordsConsoleInterfaceState) | ||
return; | ||
|
||
_window?.UpdateState(shuttleRecordsConsoleInterfaceState); | ||
} | ||
|
||
/* | ||
* This black magic code prevents multiple pop ups of the window from appearing. | ||
*/ | ||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
return; | ||
_window?.Dispose(); | ||
} | ||
|
||
private void CopyDeed(ShuttleRecord shuttleRecord) | ||
{ | ||
if (!EntMan.GetEntity(shuttleRecord.EntityUid).Valid) | ||
return; | ||
|
||
SendMessage(new CopyDeedMessage(shuttleRecord.EntityUid)); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
Content.Client/_NF/ShuttleRecords/UI/ShuttleRecordDetailsControl.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<PanelContainer xmlns="https://spacestation14.io" | ||
Access="Public" | ||
HorizontalExpand="True" | ||
VerticalExpand="True" | ||
MinSize="250 300"> | ||
<BoxContainer Orientation="Vertical" SeparationOverride="4"> | ||
<Label Name="ShuttleName" Margin="4 0 0 0" /> | ||
<Label Name="ShuttleOwner" Margin="4 0 0 0" /> | ||
<Label Name="ShuttleActivity" Margin="4 0 0 0" /> | ||
<Label Name="ShuttlePrice" Margin="4 0 0 0" /> | ||
<RichTextLabel Name="TimeOfPurchase" Margin="4 0 0 0" Access="Public" /> | ||
<Label Name="VoucherStatus" Margin="4 0 0 0" FontColorOverride="Yellow" /> | ||
<Button Name="CopyDeedButton" | ||
Access="Public" | ||
Text="" | ||
TextAlign="Center" | ||
Margin="5" | ||
StyleIdentifier="mainMenu"> | ||
|
||
<BoxContainer Orientation="Vertical" Access="Public" Margin="5"> | ||
<Label Name="CopyDeedButtonLabel" Access="Public" Text="{Loc 'shuttle-records-copy-deed-button'}"/> | ||
<Label Name="TransactionCostLabel" Text=""/> | ||
</BoxContainer> | ||
</Button> | ||
</BoxContainer> | ||
</PanelContainer> |
42 changes: 42 additions & 0 deletions
42
Content.Client/_NF/ShuttleRecords/UI/ShuttleRecordDetailsControl.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Content.Client.Message; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client._NF.ShuttleRecords.UI; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class ShuttleRecordDetailsControl : PanelContainer | ||
{ | ||
public sealed class ViewState(string shuttleName, string shuttleOwnerName, string activity, string toolTip, string timeOfPurchase, string voucherStatus, string transactionCost, string shuttlePrice) | ||
{ | ||
public string ShuttleName { get; } = shuttleName; | ||
|
||
public string ShuttleOwnerName { get; } = shuttleOwnerName; | ||
|
||
public string Activity { get; } = activity; | ||
|
||
public string ShuttlePrice { get; } = shuttlePrice; | ||
|
||
public string ToolTip { get; } = toolTip; | ||
|
||
public string TimeOfPurchase { get; } = timeOfPurchase; | ||
|
||
public string VoucherStatus { get; } = voucherStatus; | ||
|
||
public string TransactionCost { get; } = transactionCost; | ||
} | ||
|
||
public ShuttleRecordDetailsControl(ViewState state) | ||
{ | ||
RobustXamlLoader.Load(this); | ||
ShuttleName.Text = state.ShuttleName; | ||
ShuttleOwner.Text = state.ShuttleOwnerName; | ||
ShuttleActivity.Text = state.Activity; | ||
ShuttlePrice.Text = state.ShuttlePrice; | ||
VoucherStatus.Text = state.VoucherStatus; | ||
TimeOfPurchase.SetMarkup(state.TimeOfPurchase); | ||
TransactionCostLabel.Text = state.TransactionCost; | ||
ToolTip = state.ToolTip; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
Content.Client/_NF/ShuttleRecords/UI/ShuttleRecordListItem.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Button xmlns="https://spacestation14.io"> | ||
<BoxContainer Orientation="Horizontal"> | ||
<Label Name="ShuttleName" Margin="4 0 0 0"/> | ||
</BoxContainer> | ||
</Button> |
26 changes: 26 additions & 0 deletions
26
Content.Client/_NF/ShuttleRecords/UI/ShuttleRecordListItem.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client._NF.ShuttleRecords.UI; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class ShuttleRecordListItem : Button | ||
{ | ||
public sealed class ViewState(string shuttleName, string toolTip = "", bool disabled = false) | ||
{ | ||
public string ShuttleName { get; } = shuttleName; | ||
|
||
public bool Disabled { get; } = disabled; | ||
|
||
public string ToolTip { get; } = toolTip; | ||
} | ||
|
||
public ShuttleRecordListItem(ViewState state) | ||
{ | ||
RobustXamlLoader.Load(this); | ||
ShuttleName.Text = state.ShuttleName; | ||
ToolTip = state.ToolTip; | ||
Disabled = state.Disabled; | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
Content.Client/_NF/ShuttleRecords/UI/ShuttleRecordsWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
Title="{Loc 'shuttle-records-console-window-title'}" | ||
MinSize="700 510"> | ||
|
||
<BoxContainer Orientation="Vertical"> | ||
|
||
<PanelContainer> | ||
<PanelContainer.PanelOverride> | ||
<graphics:StyleBoxFlat BackgroundColor="#1B1E1B" /> | ||
</PanelContainer.PanelOverride> | ||
|
||
<GridContainer Columns="3" HorizontalExpand="True" Margin="10"> | ||
<Label Text="{Loc 'id-card-console-window-target-id'}" /> | ||
<Button Name="TargetIdButton" Access="Public" /> | ||
<Label Name="TargetIdLabel" /> | ||
<Label Text="{Loc 'id-card-console-window-ship-name-label'}" /> | ||
<Label Name="ShipNameLabel" /> | ||
</GridContainer> | ||
</PanelContainer> | ||
|
||
<BoxContainer HorizontalExpand="True" VerticalExpand="True" Orientation="Horizontal" Margin="10"> | ||
|
||
<BoxContainer Orientation="Vertical" Margin="0 0 10 0" VerticalExpand="True"> | ||
<BoxContainer Orientation="Vertical" Margin="0 0 0 5"> | ||
<Label Text="{Loc 'shuttle-records-search'}" StyleClasses="LabelSubText" Margin="0 0 5 0" /> | ||
<BoxContainer Orientation="Horizontal"> | ||
<LineEdit Name="SearchText" Access="Public" MinHeight="30" SetWidth="200" /> | ||
<Button Name="ClearSearchButton" Access="Public" Text="✖" Margin="5 0 0 0" /> | ||
</BoxContainer> | ||
<CheckBox Name="ShowActiveOnlyCheckbox" Text="{Loc 'shuttle-records-show-active-only'}" /> | ||
</BoxContainer> | ||
|
||
<BoxContainer Orientation="Vertical" MinSize="250 300" VerticalExpand="True"> | ||
<PanelContainer VerticalExpand="True" HorizontalExpand="True"> | ||
<PanelContainer.PanelOverride> | ||
<graphics:StyleBoxFlat BorderThickness="2" BorderColor="#777777" /> | ||
</PanelContainer.PanelOverride> | ||
<BoxContainer Orientation="Vertical" | ||
VerticalExpand="True" | ||
HorizontalExpand="True" | ||
SetWidth="240"> | ||
|
||
<ScrollContainer HorizontalExpand="True" | ||
VerticalExpand="True" | ||
VScrollEnabled="True"> | ||
<BoxContainer Name="ShuttleRecordList" | ||
Orientation="Vertical" | ||
HorizontalExpand="True" | ||
VerticalExpand="True" | ||
MinSize="50 50" | ||
Margin="4"> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
</BoxContainer> | ||
</PanelContainer> | ||
</BoxContainer> | ||
</BoxContainer> | ||
|
||
<BoxContainer Name="ShuttleRecordDetailsContainer" Orientation="Vertical" MinSize="250 250" VerticalExpand="True"> | ||
<Label Text="{Loc 'shuttle-records-detail-title'}" /> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</controls:FancyWindow> |
Oops, something went wrong.