Add container-related triggers (#39647)

* added triggers for when an entity is inserted or removed from a container, for both the entity and the container

* removed unnecessary comments

* consolidated into one shared system for all four triggers

* consolidated into one shared system for all four triggers

* named it right this time

* made container owner user of got triggers and added guard statements

* container id

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

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Artxmisery
2025-08-14 23:53:48 +00:00
committed by GitHub
parent 96cc6a7785
commit 2b31fa98c9
5 changed files with 142 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Trigger.Components.Triggers;
/// <summary>
/// Triggers an entity when something is inserted into it.
/// The user is the entity being inserted into the container.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class TriggerOnInsertedIntoContainerComponent : BaseTriggerOnXComponent
{
/// <summary>
/// The container to the entity has to be inserted into.
/// Null will allow all containers.
/// </summary>
[DataField, AutoNetworkedField]
public string? ContainerId;
}