6
StarHorizon_Public/Content.Client/Cargo/BUI/FundingAllocationConsoleBoundUserInterface.cs
2025-12-18 02:55:17 +03:00

36 lines
920 B
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 FundingAllocationConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey)
{
[ViewVariables]
private FundingAllocationMenu? _menu;
protected override void Open()
{
base.Open();
_menu = this.CreateWindow<FundingAllocationMenu>();
_menu.OnSavePressed += (dicts, primary, lockbox) =>
{
SendMessage(new SetFundingAllocationBuiMessage(dicts, primary, lockbox));
};
}
protected override void UpdateState(BoundUserInterfaceState message)
{
base.UpdateState(message);
if (message is not FundingAllocationConsoleBuiState state)
return;
_menu?.Update(state);
}
}