Voice Mask refactor (#30798)
* First commit * Added base.Initialize() * Voice wire fix (Electricty name) * Various minor cleanups * Localized default voice mask name * Added VoiceOverride stuff * Removed unused stuff * Typo * Better localized stuff * Typo / spelling stuff / comments * Blessed
This commit is contained in:
22
Content.Server/Speech/EntitySystems/VoiceOverrideSystem.cs
Normal file
22
Content.Server/Speech/EntitySystems/VoiceOverrideSystem.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Content.Shared.Chat;
|
||||
using Content.Server.Speech.Components;
|
||||
|
||||
namespace Content.Server.Speech.EntitySystems;
|
||||
|
||||
public sealed partial class VoiceOverrideSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<VoiceOverrideComponent, TransformSpeakerNameEvent>(OnTransformSpeakerName);
|
||||
}
|
||||
|
||||
private void OnTransformSpeakerName(Entity<VoiceOverrideComponent> entity, ref TransformSpeakerNameEvent args)
|
||||
{
|
||||
if (!entity.Comp.Enabled)
|
||||
return;
|
||||
|
||||
args.VoiceName = entity.Comp.NameOverride ?? args.VoiceName;
|
||||
args.SpeechVerb = entity.Comp.SpeechVerbOverride ?? args.SpeechVerb;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user