mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +00:00
* Add struct for holding historical data on cargo bounties * Add localisation strings for bounty history * Add new XAML entry for display bounty history * Expand cargo bounty menu to include tabs * Ensure station databases hold historical bounty data * Add to the bounty history when removing one from active * Feed bounty history into cargo's bounty system
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using Content.Client.Cargo.UI;
|
|
using Content.Shared.Cargo.Components;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.UserInterface;
|
|
|
|
namespace Content.Client.Cargo.BUI;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class CargoBountyConsoleBoundUserInterface : BoundUserInterface
|
|
{
|
|
[ViewVariables]
|
|
private CargoBountyMenu? _menu;
|
|
|
|
public CargoBountyConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = this.CreateWindow<CargoBountyMenu>();
|
|
|
|
_menu.OnLabelButtonPressed += id =>
|
|
{
|
|
SendMessage(new BountyPrintLabelMessage(id));
|
|
};
|
|
|
|
_menu.OnSkipButtonPressed += id =>
|
|
{
|
|
SendMessage(new BountySkipMessage(id));
|
|
};
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState message)
|
|
{
|
|
base.UpdateState(message);
|
|
|
|
if (message is not CargoBountyConsoleState state)
|
|
return;
|
|
|
|
_menu?.UpdateEntries(state.Bounties, state.History, state.UntilNextSkip);
|
|
}
|
|
}
|