Fix sloshing electricity & enable SpeechVerb masking (#24238)

* Implemented electricity speech verb masking

* Handle speech verb override elsewhere in the system, even though we're not using it

* Fix that protoId business

* No nullable component fields

* Use ProtoId, and try going back to a nullable.
Specifiy DataFields on VoiceMaskComponent.
This commit is contained in:
Tayrtahn
2024-01-23 17:12:18 -05:00
committed by GitHub
parent 1fb9d79c62
commit b4046bc2bb
7 changed files with 62 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ using Content.Shared.Chat;
using Content.Shared.Database;
using Content.Shared.Radio;
using Content.Shared.Radio.Components;
using Content.Shared.Speech;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Player;
@@ -79,7 +80,17 @@ public sealed class RadioSystem : EntitySystem
name = FormattedMessage.EscapeText(name);
var speech = _chat.GetSpeechVerb(messageSource, message);
SpeechVerbPrototype speech;
if (mask != null
&& mask.Enabled
&& mask.SpeechVerb != null
&& _prototype.TryIndex<SpeechVerbPrototype>(mask.SpeechVerb, out var proto))
{
speech = proto;
}
else
speech = _chat.GetSpeechVerb(messageSource, message);
var content = escapeMarkup
? FormattedMessage.EscapeText(message)
: message;