From 73d8fce7342f57fec98cf119de3023f144a5d4a3 Mon Sep 17 00:00:00 2001 From: lzk <124214523+lzk228@users.noreply.github.com> Date: Thu, 26 Dec 2024 18:42:47 +0100 Subject: [PATCH] Add holopad tts --- Content.Server/Telephone/TelephoneSystem.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Content.Server/Telephone/TelephoneSystem.cs b/Content.Server/Telephone/TelephoneSystem.cs index d4398c76d3f..5fd4b906386 100644 --- a/Content.Server/Telephone/TelephoneSystem.cs +++ b/Content.Server/Telephone/TelephoneSystem.cs @@ -6,6 +6,7 @@ using Content.Server.Speech; using Content.Server.Speech.Components; using Content.Shared.Chat; +using Content.Shared.Corvax.TTS; using Content.Shared.Database; using Content.Shared.Mind.Components; using Content.Shared.Power; @@ -109,6 +110,18 @@ private void OnTelephoneMessageReceived(Entity entity, ref T ("originalName", nameEv.VoiceName)); var volume = entity.Comp.SpeakerVolume == TelephoneVolume.Speak ? InGameICChatType.Speak : InGameICChatType.Whisper; + // Corvax-TTS-Start + // If speaker entity has TTS, the telephone will speak with the same voice + if(TryComp(args.MessageSource, out var ttsSpeaker)) + { + _entManager.EnsureComponent(entity, out var ttsTelephone) + ttsTelephone.VoicePrototypeId = ttsSpeaker.VoicePrototypeId + } + else // Remove TTS if the speaker has no TTS + { + entityManager.RemoveComponent(entity); + } + // Corvax-TTS-End _chat.TrySendInGameICMessage(entity, args.Message, volume, ChatTransmitRange.GhostRangeLimit, nameOverride: name, checkRadioPrefix: false); }