2022-09-11 18:56:21 -07:00
|
|
|
|
using Content.Client.UserInterface.Controls;
|
2022-06-10 03:28:24 +02:00
|
|
|
|
using Content.Shared.DeviceNetwork;
|
|
|
|
|
|
using Robust.Client.AutoGenerated;
|
|
|
|
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.NetworkConfigurator;
|
|
|
|
|
|
|
|
|
|
|
|
[GenerateTypedNameReferences]
|
|
|
|
|
|
public sealed partial class NetworkConfiguratorListMenu : FancyWindow
|
|
|
|
|
|
{
|
2024-07-21 14:48:13 +10:00
|
|
|
|
public event Action<string>? OnRemoveAddress;
|
|
|
|
|
|
|
|
|
|
|
|
public NetworkConfiguratorListMenu()
|
2022-06-10 03:28:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
RobustXamlLoader.Load(this);
|
2024-07-21 14:48:13 +10:00
|
|
|
|
DeviceList.OnRemoveAddress += args =>
|
|
|
|
|
|
{
|
|
|
|
|
|
OnRemoveAddress?.Invoke(args);
|
|
|
|
|
|
};
|
2022-06-10 03:28:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void UpdateState(NetworkConfiguratorUserInterfaceState state)
|
|
|
|
|
|
{
|
|
|
|
|
|
DeviceCountLabel.Text = Loc.GetString("network-configurator-ui-count-label", ("count", state.DeviceList.Count));
|
2024-07-21 14:48:13 +10:00
|
|
|
|
DeviceList.UpdateState(state.DeviceList, true);
|
2022-06-10 03:28:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|