Files
tbd-station-14/Content.Shared/Speech/Muting/MutingSystem.cs
2022-12-19 08:41:47 +11:00

22 lines
651 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, uid);
args.Cancel();
}
}
}