Files
tbd-station-14/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs
Nemanja 4662d463b8 Chill bounties + fixes (#23411)
* Chill bounties + fixes

* localize

* fix arbitage
2024-01-03 17:34:47 -07:00

35 lines
897 B
C#

using Content.Client.UserInterface.Controls;
using Content.Shared.Cargo;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.Cargo.UI;
[GenerateTypedNameReferences]
public sealed partial class CargoBountyMenu : FancyWindow
{
public Action<string>? OnLabelButtonPressed;
public CargoBountyMenu()
{
RobustXamlLoader.Load(this);
}
public void UpdateEntries(List<CargoBountyData> bounties)
{
BountyEntriesContainer.Children.Clear();
foreach (var b in bounties)
{
var entry = new BountyEntry(b);
entry.OnButtonPressed += () => OnLabelButtonPressed?.Invoke(b.Id);
BountyEntriesContainer.AddChild(entry);
}
BountyEntriesContainer.AddChild(new Control
{
MinHeight = 10
});
}
}