1
0

NetworkConfiguratorListMenu.xaml.cs 869 B

12345678910111213141516171819202122232425262728
  1. using Content.Client.UserInterface.Controls;
  2. using Content.Shared.DeviceNetwork;
  3. using Robust.Client.AutoGenerated;
  4. using Robust.Client.UserInterface.Controls;
  5. using Robust.Client.UserInterface.XAML;
  6. namespace Content.Client.NetworkConfigurator;
  7. [GenerateTypedNameReferences]
  8. public sealed partial class NetworkConfiguratorListMenu : FancyWindow
  9. {
  10. public event Action<string>? OnRemoveAddress;
  11. public NetworkConfiguratorListMenu()
  12. {
  13. RobustXamlLoader.Load(this);
  14. DeviceList.OnRemoveAddress += args =>
  15. {
  16. OnRemoveAddress?.Invoke(args);
  17. };
  18. }
  19. public void UpdateState(NetworkConfiguratorUserInterfaceState state)
  20. {
  21. DeviceCountLabel.Text = Loc.GetString("network-configurator-ui-count-label", ("count", state.DeviceList.Count));
  22. DeviceList.UpdateState(state.DeviceList, true);
  23. }
  24. }