2023-06-22 07:49:33 -04:00
|
|
|
using Content.Client.Cargo.UI;
|
|
|
|
|
using Content.Shared.Cargo.Components;
|
|
|
|
|
using JetBrains.Annotations;
|
2024-07-21 14:48:13 +10:00
|
|
|
using Robust.Client.UserInterface;
|
2023-06-22 07:49:33 -04:00
|
|
|
|
|
|
|
|
namespace Content.Client.Cargo.BUI;
|
|
|
|
|
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
public sealed class CargoBountyConsoleBoundUserInterface : BoundUserInterface
|
|
|
|
|
{
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
private CargoBountyMenu? _menu;
|
|
|
|
|
|
2023-07-08 09:02:17 -07:00
|
|
|
public CargoBountyConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
2023-06-22 07:49:33 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Open()
|
|
|
|
|
{
|
|
|
|
|
base.Open();
|
|
|
|
|
|
2024-07-21 14:48:13 +10:00
|
|
|
_menu = this.CreateWindow<CargoBountyMenu>();
|
2023-06-22 07:49:33 -04:00
|
|
|
|
|
|
|
|
_menu.OnLabelButtonPressed += id =>
|
|
|
|
|
{
|
|
|
|
|
SendMessage(new BountyPrintLabelMessage(id));
|
|
|
|
|
};
|
|
|
|
|
|
2024-04-10 00:18:07 +02:00
|
|
|
_menu.OnSkipButtonPressed += id =>
|
|
|
|
|
{
|
|
|
|
|
SendMessage(new BountySkipMessage(id));
|
|
|
|
|
};
|
2023-06-22 07:49:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState message)
|
|
|
|
|
{
|
|
|
|
|
base.UpdateState(message);
|
|
|
|
|
|
|
|
|
|
if (message is not CargoBountyConsoleState state)
|
|
|
|
|
return;
|
|
|
|
|
|
2024-04-10 00:18:07 +02:00
|
|
|
_menu?.UpdateEntries(state.Bounties, state.UntilNextSkip);
|
2023-06-22 07:49:33 -04:00
|
|
|
}
|
|
|
|
|
}
|