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:
@@ -2,7 +2,6 @@ using Content.Server.Administration.Logs;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Radio.Components;
|
||||
using Content.Server.VoiceMask;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Radio;
|
||||
@@ -78,20 +77,15 @@ public sealed class RadioSystem : EntitySystem
|
||||
if (!_messages.Add(message))
|
||||
return;
|
||||
|
||||
var name = TryComp(messageSource, out VoiceMaskComponent? mask) && mask.Enabled
|
||||
? mask.VoiceName
|
||||
: MetaData(messageSource).EntityName;
|
||||
var evt = new TransformSpeakerNameEvent(messageSource, MetaData(messageSource).EntityName);
|
||||
RaiseLocalEvent(messageSource, evt);
|
||||
|
||||
var name = evt.VoiceName;
|
||||
name = FormattedMessage.EscapeText(name);
|
||||
|
||||
SpeechVerbPrototype speech;
|
||||
if (mask != null
|
||||
&& mask.Enabled
|
||||
&& mask.SpeechVerb != null
|
||||
&& _prototype.TryIndex<SpeechVerbPrototype>(mask.SpeechVerb, out var proto))
|
||||
{
|
||||
speech = proto;
|
||||
}
|
||||
if (evt.SpeechVerb != null && _prototype.TryIndex(evt.SpeechVerb, out var evntProto))
|
||||
speech = evntProto;
|
||||
else
|
||||
speech = _chat.GetSpeechVerb(messageSource, message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user