-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'new-frontiers-14:master' into SW-KnuckleVerse
- Loading branch information
Showing
155 changed files
with
19,534 additions
and
6,866 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
Content.Client/_NF/Contraband/BUI/ContrabandPalletConsoleBoundUserInterface.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,60 @@ | ||
using Content.Client._NF.Contraband.UI; | ||
using Content.Shared._NF.Contraband.BUI; | ||
using Content.Shared._NF.Contraband.Events; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client._NF.Contraband.BUI; | ||
|
||
public sealed class ContrabandPalletConsoleBoundUserInterface : BoundUserInterface | ||
{ | ||
[ViewVariables] | ||
private ContrabandPalletMenu? _menu; | ||
|
||
public ContrabandPalletConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
var disclaimer = new FormattedMessage(); | ||
disclaimer.AddText(Loc.GetString($"contraband-pallet-disclaimer")); | ||
_menu = new ContrabandPalletMenu(); | ||
_menu.AppraiseRequested += OnAppraisal; | ||
_menu.SellRequested += OnSell; | ||
_menu.OnClose += Close; | ||
_menu.Disclaimer.SetMessage(disclaimer); | ||
_menu.OpenCentered(); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (disposing) | ||
{ | ||
_menu?.Dispose(); | ||
} | ||
} | ||
|
||
private void OnAppraisal() | ||
{ | ||
SendMessage(new ContrabandPalletAppraiseMessage()); | ||
} | ||
|
||
private void OnSell() | ||
{ | ||
SendMessage(new ContrabandPalletSellMessage()); | ||
} | ||
|
||
protected override void UpdateState(BoundUserInterfaceState state) | ||
{ | ||
base.UpdateState(state); | ||
|
||
if (state is not ContrabandPalletConsoleInterfaceState palletState) | ||
return; | ||
|
||
_menu?.SetEnabled(palletState.Enabled); | ||
_menu?.SetAppraisal(palletState.Appraisal); | ||
_menu?.SetCount(palletState.Count); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
Content.Client/_NF/Contraband/UI/ContrabandPalletMenu.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,28 @@ | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
SetSize="300 196" | ||
MinSize="300 196"> | ||
<BoxContainer Orientation="Vertical"> | ||
<BoxContainer Orientation="Horizontal" SetHeight="24"> | ||
<Label Text="{Loc 'contraband-pallet-menu-appraisal-label'}" | ||
StyleClasses="LabelKeyText" /> | ||
<Label Name="AppraisalLabel" | ||
Text="{Loc 'contraband-pallet-menu-no-goods-text'}" /> | ||
</BoxContainer> | ||
<BoxContainer Orientation="Horizontal" SetHeight="24"> | ||
<Label Text="{Loc 'contraband-pallet-menu-count-label'}" | ||
StyleClasses="LabelKeyText" /> | ||
<Label Name="CountLabel" | ||
Text="{Loc 'contraband-pallet-menu-no-goods-text'}" /> | ||
</BoxContainer> | ||
<BoxContainer Orientation = "Horizontal" VerticalExpand = "False" SetHeight="58"> | ||
<RichTextLabel Name="Disclaimer" Access="Public" StyleClasses="LabelSubText"/> | ||
</BoxContainer> | ||
<Button Name="AppraiseButton" | ||
Text="{Loc 'contraband-pallet-appraise-button'}"/> | ||
<Button Name="SellButton" | ||
Text="{Loc 'contraband-pallet-sell-button'}"/> | ||
<TextureButton VerticalExpand="True" /> | ||
</BoxContainer> | ||
</controls:FancyWindow> |
47 changes: 47 additions & 0 deletions
47
Content.Client/_NF/Contraband/UI/ContrabandPalletMenu.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,47 @@ | ||
using Content.Client.UserInterface.Controls; | ||
using Content.Shared._NF.Contraband.Components; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client._NF.Contraband.UI; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class ContrabandPalletMenu : FancyWindow | ||
{ | ||
public Action? SellRequested; | ||
public Action? AppraiseRequested; | ||
|
||
public ContrabandPalletMenu() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
SellButton.OnPressed += OnSellPressed; | ||
AppraiseButton.OnPressed += OnAppraisePressed; | ||
Title = Loc.GetString("contraband-pallet-console-menu-title"); | ||
} | ||
|
||
public void SetAppraisal(int amount) | ||
{ | ||
AppraisalLabel.Text = Loc.GetString("contraband-console-menu-points-amount", ("amount", amount.ToString())); | ||
} | ||
|
||
public void SetCount(int count) | ||
{ | ||
CountLabel.Text = count.ToString(); | ||
} | ||
public void SetEnabled(bool enabled) | ||
{ | ||
AppraiseButton.Disabled = !enabled; | ||
SellButton.Disabled = !enabled; | ||
} | ||
|
||
private void OnSellPressed(BaseButton.ButtonEventArgs obj) | ||
{ | ||
SellRequested?.Invoke(); | ||
} | ||
|
||
private void OnAppraisePressed(BaseButton.ButtonEventArgs obj) | ||
{ | ||
AppraiseRequested?.Invoke(); | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
Content.Server/Construction/Components/ComputerTabletopBoardComponent.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,15 @@ | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
||
namespace Content.Server.Construction.Components | ||
{ | ||
/// <summary> | ||
/// Used for construction graphs in building tabletop computers. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class ComputerTabletopBoardComponent : Component | ||
{ | ||
[DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] | ||
public string? Prototype { get; private set; } | ||
} | ||
} |
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
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
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
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
7 changes: 7 additions & 0 deletions
7
Content.Server/_NF/Contraband/Components/ContrabandPalletComponent.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,7 @@ | ||
namespace Content.Server._NF.Contraband.Components; | ||
|
||
/// <summary> | ||
/// Any entities intersecting when a shuttle is recalled will be sold. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class ContrabandPalletComponent : Component {} |
13 changes: 13 additions & 0 deletions
13
Content.Server/_NF/Contraband/Components/ContrabandPalletConsoleComponent.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,13 @@ | ||
using Content.Server._NF.Contraband.Systems; | ||
using Content.Shared.Stacks; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
||
namespace Content.Server._NF.Contraband.Components; | ||
|
||
[RegisterComponent] | ||
[Access(typeof(ContrabandSystem))] | ||
public sealed partial class ContrabandPalletConsoleComponent : Component | ||
{ | ||
[ViewVariables(VVAccess.ReadWrite), DataField("cashType", customTypeSerializer:typeof(PrototypeIdSerializer<StackPrototype>))] | ||
public string RewardType = "FrontierUplinkCoin"; | ||
} |
Oops, something went wrong.