diff --git a/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs b/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs index 04075000f5b..c82349bf4d3 100644 --- a/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs +++ b/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs @@ -39,6 +39,6 @@ protected override void UpdateState(BoundUserInterfaceState message) if (message is not CargoBountyConsoleState state) return; - _menu?.UpdateEntries(state.Bounties, state.History, state.UntilNextSkip); + _menu?.UpdateEntries(state.Bounties, state.History, state.UntilNextSkip); // DeltaV } } diff --git a/Content.Client/Cargo/UI/CargoBountyMenu.xaml b/Content.Client/Cargo/UI/CargoBountyMenu.xaml index 0f093d5f8e7..abf44ba9689 100644 --- a/Content.Client/Cargo/UI/CargoBountyMenu.xaml +++ b/Content.Client/Cargo/UI/CargoBountyMenu.xaml @@ -11,6 +11,7 @@ + + diff --git a/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs b/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs index 0717aacc5e6..ca46702b0b7 100644 --- a/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs +++ b/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs @@ -1,4 +1,5 @@ using Content.Client.UserInterface.Controls; +using Content.Client.DeltaV.Cargo.UI; // DeltaV using Content.Shared.Cargo; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; @@ -17,10 +18,12 @@ public CargoBountyMenu() RobustXamlLoader.Load(this); } - public void UpdateEntries(List bounties, List history, TimeSpan untilNextSkip) + public void UpdateEntries(List bounties, List history, TimeSpan untilNextSkip) // DeltaV { + // DeltaV - Start of bounty history changes MasterTabContainer.SetTabTitle(0, Loc.GetString("bounty-console-tab-available-label")); MasterTabContainer.SetTabTitle(1, Loc.GetString("bounty-console-tab-history-label")); + // DeltaV - End of bounty history changes BountyEntriesContainer.Children.Clear(); foreach (var b in bounties) @@ -36,11 +39,13 @@ public void UpdateEntries(List bounties, List Bounties = new(); + // DeltaV - Start of bounty history changes /// /// A list of all the bounties that have been completed or /// skipped for a station. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public List History = new(); + // DeltaV - End of bounty history changes /// /// Used to determine unique order IDs diff --git a/Content.Server/Cargo/Systems/CargoSystem.Bounty.cs b/Content.Server/Cargo/Systems/CargoSystem.Bounty.cs index 236b018a9da..803c23afdf2 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Bounty.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Bounty.cs @@ -8,7 +8,7 @@ using Content.Shared.Cargo.Components; using Content.Shared.Cargo.Prototypes; using Content.Shared.Database; -using Content.Shared.IdentityManagement; +using Content.Shared.IdentityManagement; // DeltaV using Content.Shared.NameIdentifier; using Content.Shared.Paper; using Content.Shared.Stacks; @@ -17,7 +17,7 @@ using Robust.Server.Containers; using Robust.Shared.Containers; using Robust.Shared.Random; -using Robust.Shared.Timing; +using Robust.Shared.Timing; // DeltaV using Robust.Shared.Utility; namespace Content.Server.Cargo.Systems; @@ -27,7 +27,7 @@ public sealed partial class CargoSystem [Dependency] private readonly ContainerSystem _container = default!; [Dependency] private readonly NameIdentifierSystem _nameIdentifier = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSys = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; // DeltaV [ValidatePrototypeId] private const string BountyNameIdentifierGroup = "Bounty"; @@ -57,7 +57,7 @@ private void OnBountyConsoleOpened(EntityUid uid, CargoBountyConsoleComponent co return; var untilNextSkip = bountyDb.NextSkipTime - _timing.CurTime; - _uiSystem.SetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(bountyDb.Bounties, bountyDb.History, untilNextSkip)); + _uiSystem.SetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(bountyDb.Bounties, bountyDb.History, untilNextSkip)); // DeltaV } private void OnPrintLabelMessage(EntityUid uid, CargoBountyConsoleComponent component, BountyPrintLabelMessage args) @@ -98,13 +98,13 @@ private void OnSkipBountyMessage(EntityUid uid, CargoBountyConsoleComponent comp return; } - if (!TryRemoveBounty(station, bounty.Value, null, args.Actor)) + if (!TryRemoveBounty(station, bounty.Value, null, args.Actor)) // DeltaV return; FillBountyDatabase(station); db.NextSkipTime = _timing.CurTime + db.SkipDelay; var untilNextSkip = db.NextSkipTime - _timing.CurTime; - _uiSystem.SetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(db.Bounties, db.History, untilNextSkip)); + _uiSystem.SetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(db.Bounties, db.History, untilNextSkip)); // DeltaV _audio.PlayPvs(component.SkipSound, uid); } @@ -437,15 +437,15 @@ public bool TryAddBounty(EntityUid uid, CargoBountyPrototype bounty, StationCarg } [PublicAPI] - public bool TryRemoveBounty(EntityUid uid, string dataId, StationCargoBountyDatabaseComponent? component = null, EntityUid? actor = null) + public bool TryRemoveBounty(EntityUid uid, string dataId, StationCargoBountyDatabaseComponent? component = null, EntityUid? actor = null) // DeltaV { if (!TryGetBountyFromId(uid, dataId, out var data, component)) return false; - return TryRemoveBounty(uid, data.Value, component, actor); + return TryRemoveBounty(uid, data.Value, component, actor); // DeltaV } - public bool TryRemoveBounty(EntityUid uid, CargoBountyData data, StationCargoBountyDatabaseComponent? component = null, EntityUid? actor = null) + public bool TryRemoveBounty(EntityUid uid, CargoBountyData data, StationCargoBountyDatabaseComponent? component = null, EntityUid? actor = null) // DeltaV { if (!Resolve(uid, ref component)) return false; @@ -454,6 +454,7 @@ public bool TryRemoveBounty(EntityUid uid, CargoBountyData data, StationCargoBou { if (component.Bounties[i].Id == data.Id) { + // DeltaV - Start of bounty history changes string? actorName = default; if (actor != null) { @@ -463,6 +464,7 @@ public bool TryRemoveBounty(EntityUid uid, CargoBountyData data, StationCargoBou } component.History.Add(new CargoBountyHistoryData(data, _gameTiming.CurTime, actorName)); + // DeltaV - End of bounty history changes component.Bounties.RemoveAt(i); return true; } diff --git a/Content.Shared/Cargo/Components/CargoBountyConsoleComponent.cs b/Content.Shared/Cargo/Components/CargoBountyConsoleComponent.cs index 8c78312be19..e0d3fd06157 100644 --- a/Content.Shared/Cargo/Components/CargoBountyConsoleComponent.cs +++ b/Content.Shared/Cargo/Components/CargoBountyConsoleComponent.cs @@ -50,13 +50,13 @@ public sealed partial class CargoBountyConsoleComponent : Component public sealed class CargoBountyConsoleState : BoundUserInterfaceState { public List Bounties; - public List History; + public List History; // DeltaV public TimeSpan UntilNextSkip; - public CargoBountyConsoleState(List bounties, List history, TimeSpan untilNextSkip) + public CargoBountyConsoleState(List bounties, List history, TimeSpan untilNextSkip) // DeltaV { Bounties = bounties; - History = history; + History = history; // DeltaV UntilNextSkip = untilNextSkip; } } diff --git a/Content.Shared/Cargo/CargoBountyHistoryData.cs b/Content.Shared/DeltaV/Cargo/CargoBountyHistoryData.cs similarity index 100% rename from Content.Shared/Cargo/CargoBountyHistoryData.cs rename to Content.Shared/DeltaV/Cargo/CargoBountyHistoryData.cs diff --git a/Resources/Locale/en-US/cargo/cargo-bounty-console.ftl b/Resources/Locale/en-US/cargo/cargo-bounty-console.ftl index 4d849c5bdab..4314cbf4496 100644 --- a/Resources/Locale/en-US/cargo/cargo-bounty-console.ftl +++ b/Resources/Locale/en-US/cargo/cargo-bounty-console.ftl @@ -18,10 +18,3 @@ bounty-console-flavor-right = v1.4 bounty-manifest-header = [font size=14][bold]Official cargo bounty manifest[/bold] (ID#{$id})[/font] bounty-manifest-list-start = Item manifest: - -bounty-console-tab-available-label = Available -bounty-console-tab-history-label = History -bounty-console-history-notice-completed-label = {$time} - Completed -bounty-console-history-notice-skipped-label = {$time} - Skipped by {$id} -bounty-console-history-completed-label = [color=limegreen]Completed[/color] -bounty-console-history-skipped-label = [color=red]Skipped[/color] diff --git a/Resources/Locale/en-US/deltav/cargo/cargo-bounty-console.ftl b/Resources/Locale/en-US/deltav/cargo/cargo-bounty-console.ftl new file mode 100644 index 00000000000..35f4c47edbf --- /dev/null +++ b/Resources/Locale/en-US/deltav/cargo/cargo-bounty-console.ftl @@ -0,0 +1,6 @@ +bounty-console-tab-available-label = Available +bounty-console-tab-history-label = History +bounty-console-history-notice-completed-label = {$time} - Completed +bounty-console-history-notice-skipped-label = {$time} - Skipped by {$id} +bounty-console-history-completed-label = [color=limegreen]Completed[/color] +bounty-console-history-skipped-label = [color=red]Skipped[/color]