37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using Content.Client.UserInterface.Controls;
|
|
using Content.Shared._NF.Pirate;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
namespace Content.Client._NF.Pirate.UI;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class PirateBountyMenu : FancyWindow
|
|
{
|
|
public Action<string>? OnLabelButtonPressed;
|
|
public Action<string>? OnSkipButtonPressed;
|
|
|
|
public PirateBountyMenu()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
}
|
|
|
|
public void UpdateEntries(List<PirateBountyData> bounties, TimeSpan untilNextSkip)
|
|
{
|
|
PirateBountyEntriesContainer.Children.Clear();
|
|
foreach (var b in bounties)
|
|
{
|
|
var entry = new PirateBountyEntry(b, untilNextSkip);
|
|
entry.OnLabelButtonPressed += () => OnLabelButtonPressed?.Invoke(b.Id);
|
|
entry.OnSkipButtonPressed += () => OnSkipButtonPressed?.Invoke(b.Id);
|
|
|
|
PirateBountyEntriesContainer.AddChild(entry);
|
|
}
|
|
PirateBountyEntriesContainer.AddChild(new Control
|
|
{
|
|
MinHeight = 10
|
|
});
|
|
}
|
|
}
|