using Content.Shared.Chat; using Content.Shared.Inventory; using Content.Shared.Speech.Components; namespace Content.Shared.Speech.EntitySystems; public sealed partial class EmoteBlockerSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnEmoteEvent); SubscribeLocalEvent>(OnRelayedEmoteEvent); } private static void OnRelayedEmoteEvent(Entity ent, ref InventoryRelayedEvent args) { OnEmoteEvent(ent, ref args.Args); } private static void OnEmoteEvent(Entity ent, ref BeforeEmoteEvent args) { if (ent.Comp.BlocksEmotes.Contains(args.Emote)) { args.Cancel(); args.Blocker = ent; return; } foreach (var blockedCat in ent.Comp.BlocksCategories) { if (blockedCat == args.Emote.Category) { args.Cancel(); args.Blocker = ent; return; } } } }