RadioSpeakerComponent.cs 889 B

123456789101112131415161718192021222324252627
  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.Set;
  5. namespace Content.Server.Radio.Components;
  6. /// <summary>
  7. /// Listens for radio messages and relays them to local chat.
  8. /// </summary>
  9. [RegisterComponent]
  10. [Access(typeof(RadioDeviceSystem))]
  11. public sealed partial class RadioSpeakerComponent : Component
  12. {
  13. /// <summary>
  14. /// Whether or not interacting with this entity
  15. /// toggles it on or off.
  16. /// </summary>
  17. [DataField("toggleOnInteract")]
  18. public bool ToggleOnInteract = true;
  19. [DataField("channels", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<RadioChannelPrototype>))]
  20. public HashSet<string> Channels = new () { SharedChatSystem.CommonChannel };
  21. [DataField("enabled")]
  22. public bool Enabled;
  23. }