ChatManager murder (#7337)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Content.Server.Chat;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Speech.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -8,22 +9,19 @@ namespace Content.Server.Speech
|
||||
{
|
||||
public sealed class AccentSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||
|
||||
public static readonly Regex SentenceRegex = new(@"(?<=[\.!\?])", RegexOptions.Compiled);
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
_chatManager.RegisterChatTransform(AccentHandler);
|
||||
SubscribeLocalEvent<TransformSpeechEvent>(AccentHandler);
|
||||
}
|
||||
|
||||
public string AccentHandler(EntityUid playerUid, string message)
|
||||
private void AccentHandler(TransformSpeechEvent args)
|
||||
{
|
||||
var accentEvent = new AccentGetEvent(playerUid, message);
|
||||
var accentEvent = new AccentGetEvent(args.Sender, args.Message);
|
||||
|
||||
RaiseLocalEvent(playerUid, accentEvent);
|
||||
|
||||
return accentEvent.Message;
|
||||
RaiseLocalEvent(args.Sender, accentEvent);
|
||||
args.Message = accentEvent.Message;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user