From: themias <89101928+themias@users.noreply.github.com> Date: Wed, 15 Jan 2025 00:10:39 +0000 (-0500) Subject: Fix muzzle accent (#34419) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=771278df5495b717b6ad9ce60100bd64b68b3937;p=space-station-14.git Fix muzzle accent (#34419) --- diff --git a/Content.Server/Speech/Components/MumbleAccentComponent.cs b/Content.Server/Speech/Components/MumbleAccentComponent.cs new file mode 100644 index 0000000000..0681ebab2f --- /dev/null +++ b/Content.Server/Speech/Components/MumbleAccentComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Server.Speech.Components; + +[RegisterComponent] +public sealed partial class MumbleAccentComponent : Component +{ + +} diff --git a/Content.Server/Speech/EntitySystems/MumbleAccentSystem.cs b/Content.Server/Speech/EntitySystems/MumbleAccentSystem.cs new file mode 100644 index 0000000000..757f31ad9e --- /dev/null +++ b/Content.Server/Speech/EntitySystems/MumbleAccentSystem.cs @@ -0,0 +1,25 @@ +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(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); + } +} diff --git a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml index 8317f8af89..5a742a20e7 100644 --- a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml +++ b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml @@ -319,8 +319,7 @@ unequipDelay: 3 - type: IngestionBlocker - type: AddAccentClothing - accent: ReplacementAccent - replacement: mumble + accent: MumbleAccent - type: Construction graph: Muzzle node: muzzle