48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using Content.Client.UserInterface.Controls;
|
|
using Content.Shared.Cargo;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Content.Shared._NF.Bank; // Frontier
|
|
|
|
namespace Content.Client.Cargo.UI;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class CargoPalletMenu : FancyWindow
|
|
{
|
|
public Action? SellRequested;
|
|
public Action? AppraiseRequested;
|
|
|
|
public CargoPalletMenu()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
SellButton.OnPressed += OnSellPressed;
|
|
AppraiseButton.OnPressed += OnAppraisePressed;
|
|
}
|
|
|
|
public void SetAppraisal(int amount)
|
|
{
|
|
AppraisalLabel.Text = BankSystemExtensions.ToSpesoString(amount); // Frontier: custom speso formatting
|
|
}
|
|
|
|
public void SetCount(int count)
|
|
{
|
|
CountLabel.Text = count.ToString();
|
|
}
|
|
public void SetEnabled(bool enabled)
|
|
{
|
|
AppraiseButton.Disabled = !enabled;
|
|
SellButton.Disabled = !enabled;
|
|
}
|
|
|
|
private void OnSellPressed(BaseButton.ButtonEventArgs obj)
|
|
{
|
|
SellRequested?.Invoke();
|
|
}
|
|
|
|
private void OnAppraisePressed(BaseButton.ButtonEventArgs obj)
|
|
{
|
|
AppraiseRequested?.Invoke();
|
|
}
|
|
}
|