6
2026-01-24 12:49:55 +03:00

36 lines
1.1 KiB
C#

using Content.Server.Chat.Systems; // Frontier: InGameICChatType
using Content.Server.Radio.EntitySystems;
using Content.Shared.Chat;
using Content.Shared.Radio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.Radio.Components;
/// <summary>
/// Listens for radio messages and relays them to local chat.
/// </summary>
[RegisterComponent]
[Access(typeof(RadioDeviceSystem))]
public sealed partial class RadioSpeakerComponent : Component
{
/// <summary>
/// Whether or not interacting with this entity
/// toggles it on or off.
/// </summary>
[DataField("toggleOnInteract")]
public bool ToggleOnInteract = true;
[DataField("channels", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<RadioChannelPrototype>))]
public HashSet<string> Channels = new () { SharedChatSystem.CommonChannel };
[DataField("enabled")]
public bool Enabled;
//Frontier: radio output volume
/// <summary>
/// The output chat type when a message is received.
/// </summary>
[DataField]
public InGameICChatType OutputChatType = InGameICChatType.Whisper;
}