Skip to content

Commit

Permalink
Add holopad tts
Browse files Browse the repository at this point in the history
  • Loading branch information
lzk228 committed Dec 26, 2024
1 parent 71c814f commit 73d8fce
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Content.Server/Telephone/TelephoneSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -109,6 +110,18 @@ private void OnTelephoneMessageReceived(Entity<TelephoneComponent> 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<TTSComponent>(args.MessageSource, out var ttsSpeaker))
{
_entManager.EnsureComponent<TTSComponent>(entity, out var ttsTelephone)

Check failure on line 117 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

; expected

Check failure on line 117 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

; expected

Check failure on line 117 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

; expected

Check failure on line 117 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

; expected

Check failure on line 117 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

; expected

Check failure on line 117 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

; expected

Check failure on line 117 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

; expected

Check failure on line 117 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

; expected
ttsTelephone.VoicePrototypeId = ttsSpeaker.VoicePrototypeId

Check failure on line 118 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

; expected

Check failure on line 118 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

; expected

Check failure on line 118 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

; expected

Check failure on line 118 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

; expected

Check failure on line 118 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

; expected

Check failure on line 118 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

; expected

Check failure on line 118 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

; expected

Check failure on line 118 in Content.Server/Telephone/TelephoneSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

; expected
}
else // Remove TTS if the speaker has no TTS
{
entityManager.RemoveComponent<TTSComponent>(entity);
}
// Corvax-TTS-End
_chat.TrySendInGameICMessage(entity, args.Message, volume, ChatTransmitRange.GhostRangeLimit, nameOverride: name, checkRadioPrefix: false);
}

Expand Down

0 comments on commit 73d8fce

Please sign in to comment.