From fd067731b544eb219493338a8fe446c154e880f4 Mon Sep 17 00:00:00 2001 From: Killerqu00 <47712032+Killerqu00@users.noreply.github.com> Date: Wed, 10 Apr 2024 00:18:07 +0200 Subject: [PATCH] Skipping bounties (#26537) * add button to menu * networking and component work * try to add access stuff * main functionality done * add access lock? I think? * remove extra line * fix access system * move SkipTime to StationCargoBountyDatabaseComponent * Disable/Enable skip button based on cooldown * remove debugging * add access denied sound * remove DataField tags * dynamic timer --- .../CargoBountyConsoleBoundUserInterface.cs | 7 +++- Content.Client/Cargo/UI/BountyEntry.xaml | 13 +++++- Content.Client/Cargo/UI/BountyEntry.xaml.cs | 33 +++++++++++++-- .../Cargo/UI/CargoBountyMenu.xaml.cs | 8 ++-- .../StationCargoBountyDatabaseComponent.cs | 13 ++++++ .../Cargo/Systems/CargoSystem.Bounty.cs | 40 +++++++++++++++++-- .../Components/CargoBountyConsoleComponent.cs | 27 ++++++++++++- .../en-US/cargo/cargo-bounty-console.ftl | 1 + .../Machines/Computers/computers.yml | 2 + 9 files changed, 132 insertions(+), 12 deletions(-) diff --git a/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs b/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs index 482acb3c87..d3365702bc 100644 --- a/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs +++ b/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs @@ -27,6 +27,11 @@ public sealed class CargoBountyConsoleBoundUserInterface : BoundUserInterface SendMessage(new BountyPrintLabelMessage(id)); }; + _menu.OnSkipButtonPressed += id => + { + SendMessage(new BountySkipMessage(id)); + }; + _menu.OpenCentered(); } @@ -37,7 +42,7 @@ public sealed class CargoBountyConsoleBoundUserInterface : BoundUserInterface if (message is not CargoBountyConsoleState state) return; - _menu?.UpdateEntries(state.Bounties); + _menu?.UpdateEntries(state.Bounties, state.UntilNextSkip); } protected override void Dispose(bool disposing) diff --git a/Content.Client/Cargo/UI/BountyEntry.xaml b/Content.Client/Cargo/UI/BountyEntry.xaml index 60446327b3..7c61323bd5 100644 --- a/Content.Client/Cargo/UI/BountyEntry.xaml +++ b/Content.Client/Cargo/UI/BountyEntry.xaml @@ -13,7 +13,18 @@ -