/// <summary> /// Dispatches an announcement on a specific station /// </summary> /// <param name="source">The entity making the announcement (used to determine the station)</param> /// <param name="message">The contents of the message</param> /// <param name="sender">The sender (Communications Console in Communications Console Announcement)</param> /// <param name="playDefaultSound">Play the announcement sound</param> /// <param name="colorOverride">Optional color for the announcement message</param> public void DispatchStationAnnouncement(EntityUid source, string message, string sender = "Central Command", bool playDefaultSound = true, SoundSpecifier?announcementSound = null, Color?colorOverride = null) { var messageWrap = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender)); var station = _stationSystem.GetOwningStation(source); if (station == null) { // you can't make a station announcement without a station return; } if (!EntityManager.TryGetComponent <StationDataComponent>(station, out var stationDataComp)) { return; } var filter = _stationSystem.GetInStation(stationDataComp); _chatManager.ChatMessageToManyFiltered(filter, ChatChannel.Radio, message, messageWrap, source, false, colorOverride); if (playDefaultSound) { SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, AudioParams.Default.WithVolume(-2f)); } _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement on {station} from {sender}: {message}"); }