1
0

RadioMicrophoneComponent.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Content.Server.Radio.EntitySystems;
  2. using Content.Shared.Chat;
  3. using Content.Shared.Radio;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  5. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  6. namespace Content.Server.Radio.Components;
  7. /// <summary>
  8. /// Listens for local chat messages and relays them to some radio frequency
  9. /// </summary>
  10. [RegisterComponent]
  11. [Access(typeof(RadioDeviceSystem))]
  12. public sealed partial class RadioMicrophoneComponent : Component
  13. {
  14. [ViewVariables(VVAccess.ReadWrite)]
  15. [DataField("broadcastChannel", customTypeSerializer: typeof(PrototypeIdSerializer<RadioChannelPrototype>))]
  16. public string BroadcastChannel = SharedChatSystem.CommonChannel;
  17. [ViewVariables(VVAccess.ReadWrite)]
  18. [DataField("listenRange")]
  19. public int ListenRange = 4;
  20. [DataField("enabled")]
  21. public bool Enabled = false;
  22. [DataField("powerRequired")]
  23. public bool PowerRequired = false;
  24. /// <summary>
  25. /// Whether or not interacting with this entity
  26. /// toggles it on or off.
  27. /// </summary>
  28. [DataField("toggleOnInteract")]
  29. public bool ToggleOnInteract = true;
  30. /// <summary>
  31. /// Whether or not the speaker must have an
  32. /// unobstructed path to the radio to speak
  33. /// </summary>
  34. [DataField("unobstructedRequired")]
  35. public bool UnobstructedRequired = false;
  36. }