Show / Hide Table of Contents

Class GetItemActionsEvent

Event raised directed at items or clothing when they are equipped or held. In order for an item to grant actions some system can subscribe to this event and add actions to the Actions list.

Inheritance
System.Object
GetItemActionsEvent
Namespace: Content.Shared.Actions
Assembly: Content.Shared.dll
Syntax
public sealed class GetItemActionsEvent : EntityEventArgs
Remarks

Note that a system could also just manually add actions as a result of a GotEquippedEvent or GotEquippedHandEvent. This exists mostly as a convenience event, while also helping to keep action-granting logic separate from general equipment behavior.

Constructors

| Improve this Doc View Source

GetItemActionsEvent(ActionContainerSystem, EntityUid, EntityUid, Nullable<SlotFlags>)

Declaration
public GetItemActionsEvent(ActionContainerSystem system, EntityUid user, EntityUid provider, SlotFlags? slotFlags = null)
Parameters
Type Name Description
ActionContainerSystem system
EntityUid user
EntityUid provider
System.Nullable<SlotFlags> slotFlags

Fields

| Improve this Doc View Source

Actions

Declaration
public readonly SortedSet<EntityUid> Actions
Field Value
Type Description
SortedSet<EntityUid>
| Improve this Doc View Source

Provider

The entity that is being asked to provide the actions. This is used as a default argument to . I.e., if a new action needs to be spawned, then it will be inserted into this entity unless otherwise specified.

Declaration
public EntityUid Provider
Field Value
Type Description
EntityUid
| Improve this Doc View Source

SlotFlags

Slot flags for the inventory slot that this item got equipped to. Null if not in a slot (i.e., if equipped to hands).

Declaration
public SlotFlags? SlotFlags
Field Value
Type Description
System.Nullable<SlotFlags>
| Improve this Doc View Source

User

User equipping the item.

Declaration
public EntityUid User
Field Value
Type Description
EntityUid

Properties

| Improve this Doc View Source

InHands

If true, the item was equipped to a users hands.

Declaration
public bool InHands { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

AddAction(EntityUid)

Declaration
public void AddAction(EntityUid actionId)
Parameters
Type Name Description
EntityUid actionId
| Improve this Doc View Source

AddAction(ref Nullable<EntityUid>, String)

Grant the given action. If the EntityUid does not refer to a valid action entity, it will create a new action and store it in Provider.

Declaration
public void AddAction(ref EntityUid? actionId, string prototypeId)
Parameters
Type Name Description
System.Nullable<EntityUid> actionId
System.String prototypeId
| Improve this Doc View Source

AddAction(ref Nullable<EntityUid>, String, EntityUid)

Grant the given action. If the EntityUid does not refer to a valid action entity, it will create a new action and store it in .

Declaration
public void AddAction(ref EntityUid? actionId, string prototypeId, EntityUid container)
Parameters
Type Name Description
System.Nullable<EntityUid> actionId
System.String prototypeId
EntityUid container
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾