* 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
23 lines
693 B
C#
23 lines
693 B
C#
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;
|
|
}
|
|
}
|