From 0d878751faf583dd253f97c40c7466374d8c9f8d Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sun, 18 May 2025 00:02:52 -0400 Subject: [PATCH] Salvage Job Board (#37549) * Salvage Job Board * More development * Small boy * Computer yaml (partial) * UI * Rank unlock logic * Job label printing * appraisal tool integration * Jobs * add board to QM locker * boom! * command desc * mild rewording * ackh, mein pr ist brohken --- .../CargoOrderConsoleBoundUserInterface.cs | 5 + .../Cargo/UI/CargoConsoleMenu.xaml.cs | 8 +- Content.Client/Salvage/UI/JobEntry.xaml | 29 ++ Content.Client/Salvage/UI/JobEntry.xaml.cs | 44 +++ .../UI/SalvageJobBoardBoundUserInterface.cs | 35 +++ .../Salvage/UI/SalvageJobBoardMenu.xaml | 45 +++ .../Salvage/UI/SalvageJobBoardMenu.xaml.cs | 38 +++ .../StationCargoBountyDatabaseComponent.cs | 8 + .../StationCargoOrderDatabaseComponent.cs | 10 + .../Cargo/Systems/CargoSystem.Bounty.cs | 12 +- .../Cargo/Systems/CargoSystem.Orders.cs | 29 +- .../Cargo/Systems/CargoSystem.Shuttle.cs | 8 +- .../Cargo/Systems/PriceGunSystem.cs | 6 + .../Salvage/JobBoard/JobBoardCommands.cs | 22 ++ .../JobBoard/JobBoardLabelComponent.cs | 17 + .../Salvage/JobBoard/SalvageJobBoardSystem.cs | 294 ++++++++++++++++++ .../JobBoard/SalvageJobsDataComponent.cs | 61 ++++ .../Cargo/BUI/CargoConsoleInterfaceState.cs | 6 +- .../Components/CargoOrderConsoleComponent.cs | 8 +- .../Prototypes/CargoBountyGroupPrototype.cs | 14 + .../Cargo/Prototypes/CargoBountyPrototype.cs | 13 + .../Labels/EntitySystems/LabelSystem.cs | 20 ++ Content.Shared/Paper/PaperSystem.cs | 6 + .../SalvageJobBoardConsoleComponent.cs | 72 +++++ Resources/Locale/en-US/cargo/bounties.ftl | 11 +- .../en-US/cargo/price-gun-component.ftl | 1 + .../en-US/commands/toolshed-commands.ftl | 2 + Resources/Locale/en-US/salvage/job-board.ftl | 47 +++ .../Prototypes/Catalog/Bounties/bounties.yml | 44 --- .../Prototypes/Catalog/Bounties/groups.yml | 11 + .../Catalog/Bounties/salvage_jobs.yml | 173 +++++++++++ .../Prototypes/Catalog/Cargo/markets.yml | 9 + .../Catalog/Fills/Lockers/heads.yml | 1 + .../Prototypes/Entities/Mobs/NPCs/carp.yml | 3 +- .../Devices/Circuitboards/computer.yml | 11 + .../Entities/Objects/Materials/materials.yml | 4 + .../Entities/Objects/Materials/ore.yml | 20 ++ .../Entities/Objects/Materials/scrap.yml | 1 + .../Entities/Objects/Misc/paper.yml | 35 +++ .../Prototypes/Entities/Stations/base.yml | 21 ++ .../Entities/Stations/nanotrasen.yml | 1 + .../Machines/Computers/computers.yml | 36 +++ Resources/Prototypes/tags.yml | 21 ++ .../Machines/computers.rsi/meta.json | 38 +++ .../Machines/computers.rsi/salvjob.png | Bin 0 -> 2221 bytes 45 files changed, 1239 insertions(+), 61 deletions(-) create mode 100644 Content.Client/Salvage/UI/JobEntry.xaml create mode 100644 Content.Client/Salvage/UI/JobEntry.xaml.cs create mode 100644 Content.Client/Salvage/UI/SalvageJobBoardBoundUserInterface.cs create mode 100644 Content.Client/Salvage/UI/SalvageJobBoardMenu.xaml create mode 100644 Content.Client/Salvage/UI/SalvageJobBoardMenu.xaml.cs create mode 100644 Content.Server/Salvage/JobBoard/JobBoardCommands.cs create mode 100644 Content.Server/Salvage/JobBoard/JobBoardLabelComponent.cs create mode 100644 Content.Server/Salvage/JobBoard/SalvageJobBoardSystem.cs create mode 100644 Content.Server/Salvage/JobBoard/SalvageJobsDataComponent.cs create mode 100644 Content.Shared/Cargo/Prototypes/CargoBountyGroupPrototype.cs create mode 100644 Content.Shared/Salvage/JobBoard/SalvageJobBoardConsoleComponent.cs create mode 100644 Resources/Locale/en-US/salvage/job-board.ftl create mode 100644 Resources/Prototypes/Catalog/Bounties/groups.yml create mode 100644 Resources/Prototypes/Catalog/Bounties/salvage_jobs.yml create mode 100644 Resources/Textures/Structures/Machines/computers.rsi/salvjob.png diff --git a/Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs b/Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs index 52846cefdb..3bd220bfad 100644 --- a/Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs +++ b/Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs @@ -138,6 +138,11 @@ namespace Content.Client.Cargo.BUI AccountName = cState.Name; + if (_menu == null) + return; + + _menu.ProductCatalogue = cState.Products; + _menu?.UpdateStation(station); Populate(cState.Orders); } diff --git a/Content.Client/Cargo/UI/CargoConsoleMenu.xaml.cs b/Content.Client/Cargo/UI/CargoConsoleMenu.xaml.cs index 4c729b795b..dfc61c0527 100644 --- a/Content.Client/Cargo/UI/CargoConsoleMenu.xaml.cs +++ b/Content.Client/Cargo/UI/CargoConsoleMenu.xaml.cs @@ -40,6 +40,8 @@ namespace Content.Client.Cargo.UI private readonly List _categoryStrings = new(); private string? _category; + public List> ProductCatalogue = new(); + public CargoConsoleMenu(EntityUid owner, IEntityManager entMan, IPrototypeManager protoManager, SpriteSystem spriteSystem) { RobustXamlLoader.Load(this); @@ -113,14 +115,16 @@ namespace Content.Client.Cargo.UI Categories.SelectId(id); } - public IEnumerable ProductPrototypes + private IEnumerable ProductPrototypes { get { var allowedGroups = _entityManager.GetComponentOrNull(_owner)?.AllowedGroups; - foreach (var cargoPrototype in _protoManager.EnumeratePrototypes()) + foreach (var cargoPrototypeId in ProductCatalogue) { + var cargoPrototype = _protoManager.Index(cargoPrototypeId); + if (!allowedGroups?.Contains(cargoPrototype.Group) ?? false) continue; diff --git a/Content.Client/Salvage/UI/JobEntry.xaml b/Content.Client/Salvage/UI/JobEntry.xaml new file mode 100644 index 0000000000..bad88f89b7 --- /dev/null +++ b/Content.Client/Salvage/UI/JobEntry.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + +