2022-09-05 17:55:44 -07:00
|
|
|
using Content.Shared.Actions;
|
2023-05-07 08:07:24 +02:00
|
|
|
using Content.Shared.DeviceNetwork.Components;
|
2022-09-05 17:55:44 -07:00
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2023-05-07 08:07:24 +02:00
|
|
|
namespace Content.Shared.DeviceNetwork.Systems;
|
2022-09-05 17:55:44 -07:00
|
|
|
|
|
|
|
|
public abstract class SharedNetworkConfiguratorSystem : EntitySystem
|
|
|
|
|
{
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<NetworkConfiguratorComponent, ComponentGetState>(GetNetworkConfiguratorState);
|
|
|
|
|
SubscribeLocalEvent<NetworkConfiguratorComponent, ComponentHandleState>(HandleNetworkConfiguratorState);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void GetNetworkConfiguratorState(EntityUid uid, NetworkConfiguratorComponent comp,
|
|
|
|
|
ref ComponentGetState args)
|
|
|
|
|
{
|
2023-05-07 08:07:24 +02:00
|
|
|
args.State = new NetworkConfiguratorComponentState(comp.ActiveDeviceList, comp.LinkModeActive);
|
2022-09-05 17:55:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void HandleNetworkConfiguratorState(EntityUid uid, NetworkConfiguratorComponent comp,
|
|
|
|
|
ref ComponentHandleState args)
|
|
|
|
|
{
|
|
|
|
|
if (args.Current is not NetworkConfiguratorComponentState state)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
comp.ActiveDeviceList = state.ActiveDeviceList;
|
2023-05-07 08:07:24 +02:00
|
|
|
comp.LinkModeActive = state.LinkModeActive;
|
2022-09-05 17:55:44 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public sealed class ClearAllOverlaysEvent : InstantActionEvent
|
|
|
|
|
{
|
|
|
|
|
}
|
2023-05-07 08:07:24 +02:00
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum NetworkConfiguratorVisuals
|
|
|
|
|
{
|
|
|
|
|
Mode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum NetworkConfiguratorLayers
|
|
|
|
|
{
|
|
|
|
|
ModeLight
|
|
|
|
|
}
|