Files
581ca2f5efefe8aeb53397af1f02bdf52012abea
26 lines
718 B
C#
26 lines
718 B
C#
using Content.Server.Speech.Components;
|
|||
|
|||
namespace Content.Server.Speech.EntitySystems;
|
|||
|
|||
public sealed class MumbleAccentSystem : EntitySystem
|
|||
{
|
|||
[Dependency] private readonly ReplacementAccentSystem _replacement = default!;
|
|||
|
|||
public override void Initialize()
|
|||
{
|
|||
base.Initialize();
|
|||
|
|||
SubscribeLocalEvent<MumbleAccentComponent, AccentGetEvent>(OnAccentGet);
|
|||
}
|
|||
|
|||
public string Accentuate(string message, MumbleAccentComponent component)
|
|||
{
|
|||
return _replacement.ApplyReplacements(message, "mumble");
|
|||
}
|
|||
|
|||
private void OnAccentGet(EntityUid uid, MumbleAccentComponent component, AccentGetEvent args)
|
|||
{
|
|||
args.Message = Accentuate(args.Message, component);
|
|||
}
|
|||
}
|