A few trait fixes (#16062)

This commit is contained in:
Scribbles0
2023-05-04 12:02:30 -07:00
committed by GitHub
parent e4b0f6e5a7
commit e6bd21e184
5 changed files with 62 additions and 55 deletions

View File

@@ -1,6 +0,0 @@
namespace Content.Shared.Speech.Muting
{
[RegisterComponent]
public sealed class MutedComponent : Component
{}
}

View File

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