Muted status effect + 2 reagent sources of it (#8673)

This commit is contained in:
Rane
2022-06-06 04:35:24 -04:00
committed by GitHub
parent 98c3b75364
commit 008348e40c
11 changed files with 81 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
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();
}
}
}