mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* move-accents-to-shared * Update AccentSystem.cs * Update ListeningSystem.cs * aaaaaa * Update AccentSystem.cs * oh god * aaooao * // * review * fix * Update VocalSystem.cs
21 lines
604 B
C#
21 lines
604 B
C#
using System.Text.RegularExpressions;
|
|
using Content.Shared.Chat;
|
|
|
|
namespace Content.Shared.Speech.EntitySystems;
|
|
|
|
public sealed partial class AccentSystem : EntitySystem
|
|
{
|
|
public static readonly Regex SentenceRegex = new(@"(?<=[\.!\?‽])(?![\.!\?‽])", RegexOptions.Compiled);
|
|
|
|
[SubscribeLocalEvent]
|
|
private void AccentHandler(TransformSpeechEvent args)
|
|
{
|
|
if (args.Cancelled)
|
|
return;
|
|
|
|
var accentEvent = new AccentGetEvent(args.Sender, args.Message);
|
|
|
|
RaiseLocalEvent(args.Sender, ref accentEvent);
|
|
args.Message = accentEvent.Message;
|
|
}
|
|
}
|