IListener and IRadio purge (#11980)

This commit is contained in:
Leon Friedrich
2022-11-15 17:09:27 +13:00
committed by GitHub
parent bc525425da
commit 0b5a58001c
48 changed files with 946 additions and 643 deletions

View File

@@ -21,7 +21,6 @@ public sealed class SurveillanceCameraSpeakerSystem : EntitySystem
public override void Initialize()
{
SubscribeLocalEvent<SurveillanceCameraSpeakerComponent, SurveillanceCameraSpeechSendEvent>(OnSpeechSent);
SubscribeLocalEvent<SurveillanceCameraSpeakerComponent, TransformSpeakerNameEvent>(OnTransformSpeech);
}
private void OnSpeechSent(EntityUid uid, SurveillanceCameraSpeakerComponent component,
@@ -71,15 +70,11 @@ public sealed class SurveillanceCameraSpeakerSystem : EntitySystem
var nameEv = new TransformSpeakerNameEvent(args.Speaker, Name(args.Speaker));
RaiseLocalEvent(args.Speaker, nameEv);
component.LastSpokenNames.Enqueue(nameEv.Name);
_chatSystem.TrySendInGameICMessage(uid, args.Message, InGameICChatType.Speak, false);
}
var name = Loc.GetString("speech-name-relay", ("speaker", Name(uid)),
("originalName", nameEv.Name));
private void OnTransformSpeech(EntityUid uid, SurveillanceCameraSpeakerComponent component,
TransformSpeakerNameEvent args)
{
args.Name = Loc.GetString("surveillance-camera-microphone-message", ("speaker", Name(uid)),
("originalName", component.LastSpokenNames.Dequeue()));
var hideGlobalGhostChat = true; // log to chat so people can identity the speaker/source, but avoid clogging ghost chat if there are many radios
_chatSystem.TrySendInGameICMessage(uid, args.Message, InGameICChatType.Speak, false, hideGlobalGhostChat, nameOverride: name);
}
}