Skip to content

Commit

Permalink
Merge pull request #76 from Corvax-Frontier/up091124
Browse files Browse the repository at this point in the history
Up091124
  • Loading branch information
Zekins3366 authored Nov 9, 2024
2 parents 3ba0e1b + c69bf56 commit fea429f
Show file tree
Hide file tree
Showing 196 changed files with 6,450 additions and 7,434 deletions.
6 changes: 3 additions & 3 deletions Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeMana
};
JobTitleSaveButton.OnPressed += _ => SubmitData();

ShipNameLineEdit.OnTextChanged += _ => EnsureValidShuttleName();
ShipSuffixLineEdit.OnTextChanged += _ => EnsureValidShuttleName();
ShipNameSaveButton.OnPressed += _ => SubmitShuttleData();
ShipNameLineEdit.OnTextChanged += _ => EnsureValidShuttleName(); // Frontier
ShipSuffixLineEdit.OnTextChanged += _ => EnsureValidShuttleName(); // Frontier
ShipNameSaveButton.OnPressed += _ => SubmitShuttleData(); // Frontier

var jobs = _prototypeManager.EnumeratePrototypes<JobPrototype>().ToList();
jobs.Sort((x, y) => string.Compare(x.LocalizedName, y.LocalizedName, StringComparison.CurrentCulture));
Expand Down
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));
}

}
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>
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;
}
}
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 Content.Client/_NF/ShuttleRecords/UI/ShuttleRecordListItem.xaml.cs
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 Content.Client/_NF/ShuttleRecords/UI/ShuttleRecordsWindow.xaml
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>
Loading

0 comments on commit fea429f

Please sign in to comment.