Device Linking and better linking ui (#13645)
Co-authored-by: AJCM-git <60196617+AJCM-git@users.noreply.github.com> Co-authored-by: Visne <39844191+Visne@users.noreply.github.com> Co-authored-by: ElectroJr <leonsfriedrich@gmail.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using Content.Shared.DeviceNetwork;
|
||||
using JetBrains.Annotations;
|
||||
using Content.Client.NetworkConfigurator.Systems;
|
||||
using Content.Shared.DeviceNetwork;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
@@ -8,17 +8,18 @@ namespace Content.Client.NetworkConfigurator;
|
||||
public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private NetworkConfiguratorListMenu? _listMenu;
|
||||
private NetworkConfiguratorConfigurationMenu? _configurationMenu;
|
||||
private NetworkConfiguratorLinkMenu? _linkMenu;
|
||||
|
||||
private NetworkConfiguratorSystem _netConfig;
|
||||
private DeviceListSystem _deviceList;
|
||||
|
||||
public NetworkConfiguratorBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_netConfig = _entityManager.System<NetworkConfiguratorSystem>();
|
||||
_deviceList = _entityManager.System<DeviceListSystem>();
|
||||
}
|
||||
|
||||
public void OnRemoveButtonPressed(string address)
|
||||
@@ -36,7 +37,7 @@ public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface
|
||||
_listMenu = new NetworkConfiguratorListMenu(this);
|
||||
_listMenu.OnClose += Close;
|
||||
_listMenu.ClearButton.OnPressed += _ => OnClearButtonPressed();
|
||||
_listMenu.OpenCentered();
|
||||
_listMenu.OpenCenteredRight();
|
||||
break;
|
||||
case NetworkConfiguratorUiKey.Configure:
|
||||
_configurationMenu = new NetworkConfiguratorConfigurationMenu();
|
||||
@@ -50,6 +51,11 @@ public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface
|
||||
_configurationMenu.Show.Pressed = _netConfig.ConfiguredListIsTracked(Owner.Owner);
|
||||
_configurationMenu.OpenCentered();
|
||||
break;
|
||||
case NetworkConfiguratorUiKey.Link:
|
||||
_linkMenu = new NetworkConfiguratorLinkMenu(this);
|
||||
_linkMenu.OnClose += Close;
|
||||
_linkMenu.OpenCentered();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +76,9 @@ public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface
|
||||
case DeviceListUserInterfaceState listState:
|
||||
_configurationMenu?.UpdateState(listState);
|
||||
break;
|
||||
case DeviceLinkUserInterfaceState linkState:
|
||||
_linkMenu?.UpdateState(linkState);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user