Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix aac tables not working on radio #1660

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Content.Server/DeltaV/AACTablet/AACTabletComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ public sealed partial class AACTabletComponent : Component
// Time that the next phrase can be sent.
[DataField]
public TimeSpan NextPhrase;
}

// Used by the RadioSystem to support intercoms.
[ViewVariables(VVAccess.ReadWrite)]
public string SpeakerName;
}
4 changes: 3 additions & 1 deletion Content.Server/DeltaV/AACTablet/AACTabletSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ private void OnSendPhrase(EntityUid uid, AACTabletComponent component, AACTablet
if (!_prototypeManager.TryIndex<QuickPhrasePrototype>(message.PhraseID, out var phrase))
return;

component.SpeakerName = speakerName;

_chat.TrySendInGameICMessage(uid,
_loc.GetString(phrase.Text),
InGameICChatType.Speak,
Expand All @@ -44,4 +46,4 @@ private void OnSendPhrase(EntityUid uid, AACTabletComponent component, AACTablet
var curTime = Timing.CurTime;
component.NextPhrase = curTime + component.Cooldown;
}
}
}
8 changes: 8 additions & 0 deletions Content.Server/Radio/EntitySystems/RadioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Server.Power.Components;
using Content.Server.Radio.Components;
using Content.Server.VoiceMask;
using Content.Server.DeltaV.AACTablet; // Delta-V: Support for AAC tablets
using Content.Shared.Chat;
using Content.Shared.Database;
using Content.Shared.Radio;
Expand Down Expand Up @@ -88,6 +89,13 @@ public void SendRadioMessage(EntityUid messageSource, string message, RadioChann

name = FormattedMessage.EscapeText(name);

// Delta-V: Support for AAC tablets.
if (TryComp(messageSource, out AACTabletComponent? aac))
name = aac.SpeakerName;

name = FormattedMessage.EscapeText(name);


SpeechVerbPrototype speech;
if (mask != null
&& mask.Enabled
Expand Down
Loading