NetworkConfiguratorComponent.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Content.Shared.DeviceLinking;
  2. using Content.Shared.DeviceNetwork.Systems;
  3. using Robust.Shared.Audio;
  4. using Robust.Shared.GameStates;
  5. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  6. namespace Content.Shared.DeviceNetwork.Components;
  7. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  8. [Access(typeof(SharedNetworkConfiguratorSystem))]
  9. public sealed partial class NetworkConfiguratorComponent : Component
  10. {
  11. // AAAAA ALL OF THESE FAA
  12. /// <summary>
  13. /// Determines whether the configurator is in linking mode or list mode
  14. /// </summary>
  15. [DataField, AutoNetworkedField]
  16. [ViewVariables(VVAccess.ReadWrite)]
  17. public bool LinkModeActive = true;
  18. /// <summary>
  19. /// The entity containing a <see cref="DeviceListComponent"/> this configurator is currently interacting with
  20. /// </summary>
  21. [DataField, AutoNetworkedField]
  22. public EntityUid? ActiveDeviceList { get; set; }
  23. /// <summary>
  24. /// The entity containing a <see cref="DeviceLinkSourceComponent"/> or <see cref="DeviceLinkSinkComponent"/> this configurator is currently interacting with.<br/>
  25. /// If this is set the configurator is in linking mode.
  26. /// </summary>
  27. // TODO handle device deletion
  28. public EntityUid? ActiveDeviceLink;
  29. /// <summary>
  30. /// The target device this configurator is currently linking with the <see cref="ActiveDeviceLink"/>
  31. /// </summary>
  32. // TODO handle device deletion
  33. public EntityUid? DeviceLinkTarget;
  34. /// <summary>
  35. /// The list of devices stored in the configurator
  36. /// </summary>
  37. [DataField]
  38. public Dictionary<string, EntityUid> Devices = new();
  39. [DataField]
  40. [ViewVariables(VVAccess.ReadWrite)]
  41. public TimeSpan UseDelay = TimeSpan.FromSeconds(0.5);
  42. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  43. [ViewVariables(VVAccess.ReadWrite)]
  44. public TimeSpan LastUseAttempt;
  45. [DataField]
  46. public SoundSpecifier SoundNoAccess = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg");
  47. [DataField]
  48. public SoundSpecifier SoundSwitchMode = new SoundPathSpecifier("/Audio/Machines/quickbeep.ogg");
  49. }