SharedNetworkConfiguratorSystem.cs 913 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Content.Shared.Actions;
  2. using Content.Shared.DeviceNetwork.Components;
  3. using Content.Shared.UserInterface;
  4. using Robust.Shared.Serialization;
  5. namespace Content.Shared.DeviceNetwork.Systems;
  6. public abstract class SharedNetworkConfiguratorSystem : EntitySystem
  7. {
  8. public override void Initialize()
  9. {
  10. base.Initialize();
  11. SubscribeLocalEvent<NetworkConfiguratorComponent, ActivatableUIOpenAttemptEvent>(OnUiOpenAttempt);
  12. }
  13. private void OnUiOpenAttempt(EntityUid uid, NetworkConfiguratorComponent configurator, ActivatableUIOpenAttemptEvent args)
  14. {
  15. if (configurator.LinkModeActive)
  16. args.Cancel();
  17. }
  18. }
  19. public sealed partial class ClearAllOverlaysEvent : InstantActionEvent
  20. {
  21. }
  22. [Serializable, NetSerializable]
  23. public enum NetworkConfiguratorVisuals
  24. {
  25. Mode
  26. }
  27. [Serializable, NetSerializable]
  28. public enum NetworkConfiguratorLayers
  29. {
  30. ModeLight
  31. }