Muted status effect + 2 reagent sources of it (#8673)
This commit is contained in:
21
Content.Shared/Speech/Muting/MutingSystem.cs
Normal file
21
Content.Shared/Speech/Muting/MutingSystem.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user