From 7ab5127286726971239a78a4d60346e0958d4327 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Thu, 22 Jun 2023 07:49:33 -0400 Subject: [PATCH] Cargo Bounties (#17344) Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> --- .../CargoBountyConsoleBoundUserInterface.cs | 54 +++ Content.Client/Cargo/UI/BountyEntry.xaml | 27 ++ Content.Client/Cargo/UI/BountyEntry.xaml.cs | 54 +++ Content.Client/Cargo/UI/CargoBountyMenu.xaml | 36 ++ .../Cargo/UI/CargoBountyMenu.xaml.cs | 34 ++ Content.IntegrationTests/Tests/CargoTest.cs | 40 ++ .../Components/CargoBountyLabelComponent.cs | 20 + .../StationCargoBountyDatabaseComponent.cs | 47 +++ .../Cargo/Systems/CargoSystem.Bounty.cs | 341 ++++++++++++++++++ .../Cargo/Systems/CargoSystem.Shuttle.cs | 21 +- Content.Server/Cargo/Systems/CargoSystem.cs | 4 + Content.Shared/Cargo/CargoBountyData.cs | 31 ++ .../Components/CargoBountyConsoleComponent.cs | 57 +++ .../Cargo/Prototypes/CargoBountyPrototype.cs | 60 +++ Content.Shared/Cargo/SharedCargoSystem.cs | 1 + Resources/Locale/en-US/cargo/bounties.ftl | 41 +++ .../en-US/cargo/cargo-bounty-console.ftl | 18 + Resources/Locale/en-US/guidebook/guides.ftl | 1 + .../Prototypes/Catalog/Bounties/bounties.yml | 219 +++++++++++ .../Catalog/Fills/Lockers/heads.yml | 1 + .../Prototypes/Entities/Mobs/NPCs/animals.yml | 1 + .../Devices/Circuitboards/computer.yml | 15 + .../Prototypes/Entities/Objects/Fun/toys.yml | 3 + .../Entities/Objects/Misc/briefcases.yml | 3 + .../Entities/Objects/Misc/paper.yml | 13 + .../Entities/Objects/Tools/toolbox.yml | 3 +- .../Objects/Weapons/Melee/baseball_bat.yml | 3 + .../Prototypes/Entities/Stations/base.yml | 1 + .../Machines/Computers/computers.yml | 33 ++ Resources/Prototypes/Guidebook/cargo.yml | 9 +- Resources/Prototypes/tags.yml | 15 + .../Guidebook/{ => Cargo}/Cargo.xml | 2 +- .../Guidebook/Cargo/CargoBounties.xml | 29 ++ .../Machines/computers.rsi/bounty.png | Bin 0 -> 2362 bytes .../Machines/computers.rsi/meta.json | 38 ++ 35 files changed, 1269 insertions(+), 6 deletions(-) create mode 100644 Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs create mode 100644 Content.Client/Cargo/UI/BountyEntry.xaml create mode 100644 Content.Client/Cargo/UI/BountyEntry.xaml.cs create mode 100644 Content.Client/Cargo/UI/CargoBountyMenu.xaml create mode 100644 Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs create mode 100644 Content.Server/Cargo/Components/CargoBountyLabelComponent.cs create mode 100644 Content.Server/Cargo/Components/StationCargoBountyDatabaseComponent.cs create mode 100644 Content.Server/Cargo/Systems/CargoSystem.Bounty.cs create mode 100644 Content.Shared/Cargo/CargoBountyData.cs create mode 100644 Content.Shared/Cargo/Components/CargoBountyConsoleComponent.cs create mode 100644 Content.Shared/Cargo/Prototypes/CargoBountyPrototype.cs create mode 100644 Resources/Locale/en-US/cargo/bounties.ftl create mode 100644 Resources/Locale/en-US/cargo/cargo-bounty-console.ftl create mode 100644 Resources/Prototypes/Catalog/Bounties/bounties.yml rename Resources/ServerInfo/Guidebook/{ => Cargo}/Cargo.xml (92%) create mode 100644 Resources/ServerInfo/Guidebook/Cargo/CargoBounties.xml create mode 100644 Resources/Textures/Structures/Machines/computers.rsi/bounty.png diff --git a/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs b/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs new file mode 100644 index 0000000000..63587d9875 --- /dev/null +++ b/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs @@ -0,0 +1,54 @@ +using Content.Client.Cargo.UI; +using Content.Shared.Cargo.Components; +using JetBrains.Annotations; +using Robust.Client.GameObjects; + +namespace Content.Client.Cargo.BUI; + +[UsedImplicitly] +public sealed class CargoBountyConsoleBoundUserInterface : BoundUserInterface +{ + [ViewVariables] + private CargoBountyMenu? _menu; + + public CargoBountyConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) + { + + } + + protected override void Open() + { + base.Open(); + + _menu = new(); + + _menu.OnClose += Close; + + _menu.OnLabelButtonPressed += id => + { + SendMessage(new BountyPrintLabelMessage(id)); + }; + + _menu.OpenCentered(); + } + + protected override void UpdateState(BoundUserInterfaceState message) + { + base.UpdateState(message); + + if (message is not CargoBountyConsoleState state) + return; + + _menu?.UpdateEntries(state.Bounties); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (!disposing) + return; + + _menu?.Dispose(); + } +} diff --git a/Content.Client/Cargo/UI/BountyEntry.xaml b/Content.Client/Cargo/UI/BountyEntry.xaml new file mode 100644 index 0000000000..e570b03746 --- /dev/null +++ b/Content.Client/Cargo/UI/BountyEntry.xaml @@ -0,0 +1,27 @@ + + + + + + + + + + + +