* add button to menu * networking and component work * try to add access stuff * main functionality done * add access lock? I think? * remove extra line * fix access system * move SkipTime to StationCargoBountyDatabaseComponent * Disable/Enable skip button based on cooldown * remove debugging * add access denied sound * remove DataField tags * dynamic timer
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
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 Action<string>? OnSkipButtonPressed;
|
|
|
|
public CargoBountyMenu()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
}
|
|
|
|
public void UpdateEntries(List<CargoBountyData> bounties, TimeSpan untilNextSkip)
|
|
{
|
|
BountyEntriesContainer.Children.Clear();
|
|
foreach (var b in bounties)
|
|
{
|
|
var entry = new BountyEntry(b, untilNextSkip);
|
|
entry.OnLabelButtonPressed += () => OnLabelButtonPressed?.Invoke(b.Id);
|
|
entry.OnSkipButtonPressed += () => OnSkipButtonPressed?.Invoke(b.Id);
|
|
|
|
BountyEntriesContainer.AddChild(entry);
|
|
}
|
|
BountyEntriesContainer.AddChild(new Control
|
|
{
|
|
MinHeight = 10
|
|
});
|
|
}
|
|
}
|