1
0

DiskConsoleMenu.xaml.cs 924 B

1234567891011121314151617181920212223242526272829
  1. using Content.Client.UserInterface.Controls;
  2. using Content.Shared.Research;
  3. using Robust.Client.AutoGenerated;
  4. using Robust.Client.UserInterface.XAML;
  5. namespace Content.Client.Research.UI;
  6. [GenerateTypedNameReferences]
  7. public sealed partial class DiskConsoleMenu : FancyWindow
  8. {
  9. public event Action? OnServerButtonPressed;
  10. public event Action? OnPrintButtonPressed;
  11. public DiskConsoleMenu()
  12. {
  13. RobustXamlLoader.Load(this);
  14. ServerButton.OnPressed += _ => OnServerButtonPressed?.Invoke();
  15. PrintButton.OnPressed += _ => OnPrintButtonPressed?.Invoke();
  16. }
  17. public void Update(DiskConsoleBoundUserInterfaceState state)
  18. {
  19. PrintButton.Disabled = !state.CanPrint;
  20. TotalLabel.Text = Loc.GetString("tech-disk-ui-total-label", ("amount", state.ServerPoints));
  21. CostLabel.Text = Loc.GetString("tech-disk-ui-cost-label", ("amount", state.PointCost));
  22. }
  23. }