1
0

CargoPalletMenu.xaml.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Content.Client.UserInterface.Controls;
  2. using Content.Shared.Cargo;
  3. using Robust.Client.AutoGenerated;
  4. using Robust.Client.UserInterface.Controls;
  5. using Robust.Client.UserInterface.XAML;
  6. namespace Content.Client.Cargo.UI;
  7. [GenerateTypedNameReferences]
  8. public sealed partial class CargoPalletMenu : FancyWindow
  9. {
  10. public Action? SellRequested;
  11. public Action? AppraiseRequested;
  12. public CargoPalletMenu()
  13. {
  14. RobustXamlLoader.Load(this);
  15. SellButton.OnPressed += OnSellPressed;
  16. AppraiseButton.OnPressed += OnAppraisePressed;
  17. }
  18. public void SetAppraisal(int amount)
  19. {
  20. AppraisalLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", amount.ToString()));
  21. }
  22. public void SetCount(int count)
  23. {
  24. CountLabel.Text = count.ToString();
  25. }
  26. public void SetEnabled(bool enabled)
  27. {
  28. AppraiseButton.Disabled = !enabled;
  29. SellButton.Disabled = !enabled;
  30. }
  31. private void OnSellPressed(BaseButton.ButtonEventArgs obj)
  32. {
  33. SellRequested?.Invoke();
  34. }
  35. private void OnAppraisePressed(BaseButton.ButtonEventArgs obj)
  36. {
  37. AppraiseRequested?.Invoke();
  38. }
  39. }