Component for clothes to suppress emotes and scream action in general, and the muzzle to suppress vocal emotes in particular (#32588)
* Component for clothes to suppress scream noise GaggedComponent + AddGaggedClothingComponent and relevant systems to make them work. Currently only stifles the scream _action_, not all emotes because if a mime can silently emote, so can gagged you! * fix comments * swap to inventory relay and make it more general such that specific emotes or emotes of a given category can be blocked * power gloves shouldn't block snapping * easy fixes * blockable emote event * pr comments, switch to using emote event mostly * pr comments add beforeEmoteEvent add emote blocker name to popup maybe some other stuff, I forget * get rid of emoteevent's source because I don't need it anymore * smol clean * formatting, style, and one minor thing where having a muzzle in your pocket would gag you
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
namespace Content.Shared.Emoting
|
||||
{
|
||||
public sealed class EmoteAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public EmoteAttemptEvent(EntityUid uid)
|
||||
{
|
||||
Uid = uid;
|
||||
}
|
||||
|
||||
public EntityUid Uid { get; }
|
||||
}
|
||||
}
|
||||
27
Content.Shared/Emoting/EmoteEvents.cs
Normal file
27
Content.Shared/Emoting/EmoteEvents.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Inventory;
|
||||
|
||||
namespace Content.Shared.Emoting;
|
||||
|
||||
public sealed class EmoteAttemptEvent(EntityUid uid) : CancellableEntityEventArgs
|
||||
{
|
||||
public EntityUid Uid { get; } = uid;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event raised just before an emote is performed, providing systems with an opportunity to cancel the emote's performance.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public sealed class BeforeEmoteEvent(EntityUid source, EmotePrototype emote)
|
||||
: CancellableEntityEventArgs, IInventoryRelayEvent
|
||||
{
|
||||
public readonly EntityUid Source = source;
|
||||
public readonly EmotePrototype Emote = emote;
|
||||
|
||||
/// <summary>
|
||||
/// The equipment that is blocking emoting. Should only be non-null if the event was canceled.
|
||||
/// </summary>
|
||||
public EntityUid? Blocker = null;
|
||||
|
||||
public SlotFlags TargetSlots => SlotFlags.WITHOUT_POCKET;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using Content.Shared.Contraband;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Events;
|
||||
using Content.Shared.Electrocution;
|
||||
using Content.Shared.Emoting;
|
||||
using Content.Shared.Explosion;
|
||||
using Content.Shared.Eye.Blinding.Systems;
|
||||
using Content.Shared.Flash;
|
||||
@@ -54,6 +55,7 @@ public partial class InventorySystem
|
||||
SubscribeLocalEvent<InventoryComponent, IsEquippingTargetAttemptEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, IsUnequippingTargetAttemptEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, ChameleonControllerOutfitSelectedEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, BeforeEmoteEvent>(RelayInventoryEvent);
|
||||
|
||||
// by-ref events
|
||||
SubscribeLocalEvent<InventoryComponent, RefreshFrictionModifiersEvent>(RefRelayInventoryEvent);
|
||||
|
||||
Reference in New Issue
Block a user