namespace Content.Shared.Emoting; public sealed class EmoteSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnEmoteAttempt); } public void SetEmoting(EntityUid uid, bool value, EmotingComponent? component = null) { if (value && !Resolve(uid, ref component)) return; component = EnsureComp(uid); if (component.Enabled == value) return; Dirty(uid, component); } private void OnEmoteAttempt(EmoteAttemptEvent args) { if (!TryComp(args.Uid, out EmotingComponent? emote) || !emote.Enabled) args.Cancel(); } }