NetworkConfiguratorConfigurationMenu.xaml.cs 986 B

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