Fix the fix for accents on radio (#10242)
This commit is contained in:
@@ -249,10 +249,6 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
|
||||
var (message, channel) = GetRadioPrefix(source, originalMessage);
|
||||
|
||||
message = TransformSpeech(source, message);
|
||||
if (message.Length == 0)
|
||||
return;
|
||||
|
||||
if (channel != null)
|
||||
{
|
||||
_listener.PingListeners(source, message, channel);
|
||||
@@ -260,6 +256,10 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
return;
|
||||
}
|
||||
|
||||
message = TransformSpeech(source, message);
|
||||
if (message.Length == 0)
|
||||
return;
|
||||
|
||||
var messageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",
|
||||
("entityName", Name(source)));
|
||||
|
||||
@@ -436,7 +436,7 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
return newMessage;
|
||||
}
|
||||
|
||||
private string TransformSpeech(EntityUid sender, string message)
|
||||
public string TransformSpeech(EntityUid sender, string message)
|
||||
{
|
||||
var ev = new TransformSpeechEvent(sender, message);
|
||||
RaiseLocalEvent(ev);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Radio.Components;
|
||||
using Content.Server.Radio.EntitySystems;
|
||||
using Content.Shared.Chat;
|
||||
@@ -21,6 +22,7 @@ namespace Content.Server.Headset
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IServerNetManager _netManager = default!;
|
||||
|
||||
private ChatSystem _chatSystem = default!;
|
||||
private RadioSystem _radioSystem = default!;
|
||||
|
||||
[DataField("channels", customTypeSerializer:typeof(PrototypeIdHashSetSerializer<RadioChannelPrototype>))]
|
||||
@@ -39,6 +41,7 @@ namespace Content.Server.Headset
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_chatSystem = EntitySystem.Get<ChatSystem>();
|
||||
_radioSystem = EntitySystem.Get<RadioSystem>();
|
||||
}
|
||||
|
||||
@@ -55,6 +58,10 @@ namespace Content.Server.Headset
|
||||
|
||||
var playerChannel = actor.PlayerSession.ConnectedClient;
|
||||
|
||||
message = _chatSystem.TransformSpeech(source, message);
|
||||
if (message.Length == 0)
|
||||
return;
|
||||
|
||||
var msg = new MsgChatMessage
|
||||
{
|
||||
Channel = ChatChannel.Radio,
|
||||
|
||||
Reference in New Issue
Block a user