Files
tbd-station-14/Content.Shared/Trigger/Components/Triggers/TriggerOnInteractUsingComponent.cs
ViolentMonk 6e8260cf3f Trigger for OnInteractUsing (#39692)
* Add trigger for InteractOnUsing

* Add blacklist and targetUsed fields

* Update Content.Shared/Trigger/Components/Triggers/TriggerOnInteractUsingComponent.cs

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2025-08-16 23:57:16 +02:00

35 lines
1.3 KiB
C#

using Content.Shared.Interaction;
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
namespace Content.Shared.Trigger.Components.Triggers;
/// <summary>
/// Triggers when an entity is used to interact with another entity (<see cref="InteractUsingEvent"/>).
/// The user is the player initiating the interaction or the item used, depending on the TargetUsed datafield.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class TriggerOnInteractUsingComponent : BaseTriggerOnXComponent
{
/// <summary>
/// Whitelist of entities that can be used to trigger this component.
/// </summary>
/// <remarks>No whitelist check when null.</remarks>
[DataField, AutoNetworkedField]
public EntityWhitelist? Whitelist;
/// <summary>
/// Blacklist of entities that cannot be used to trigger this component.
/// </summary>
/// <remarks>No blacklist check when null.</remarks>
[DataField, AutoNetworkedField]
public EntityWhitelist? Blacklist;
/// <summary>
/// If false, the trigger user will be the user that initiated the interaction.
/// If true, the trigger user will the entity that was used to interact.
/// </summary>
[DataField, AutoNetworkedField]
public bool TargetUsed = false;
}