Files
tbd-station-14/Content.Shared/Speech/Muting/MutingSystem.cs

22 lines
668 B
C#

using Content.Shared.Popups;
using Robust.Shared.Player;
namespace Content.Shared.Speech.Muting
{
public sealed class MutingSystem : EntitySystem
{
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MutedComponent, SpeakAttemptEvent>(OnSpeakAttempt);
}
private void OnSpeakAttempt(EntityUid uid, MutedComponent component, SpeakAttemptEvent args)
{
_popupSystem.PopupEntity(Loc.GetString("speech-muted"), uid, Filter.Entities(uid));
args.Cancel();
}
}
}