Class BaseActionComponent
Namespace: Content.Shared.Actions
Assembly: Content.Shared.dll
Syntax
public abstract class BaseActionComponent : Component
Fields
| Improve this Doc View SourceAttachedEntity
What entity, if any, currently has this action in the actions component?
Declaration
public EntityUid? AttachedEntity
Field Value
Type | Description |
---|---|
System.Nullable<EntityUid> |
AutoPopulate
Whether or not to automatically add this action to the action bar when it becomes available.
Declaration
public bool AutoPopulate
Field Value
Type | Description |
---|---|
System.Boolean |
Charges
Convenience tool for actions with limited number of charges. Automatically decremented on use, and the action is disabled when it reaches zero. Does NOT automatically remove the action from the action bar.
Declaration
public int? Charges
Field Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
CheckCanInteract
Whether the action system should block this action if the user cannot currently interact. Some spells or abilities may want to disable this and implement their own checks.
Declaration
public bool CheckCanInteract
Field Value
Type | Description |
---|---|
System.Boolean |
ClientExclusive
If true, this will cause the action to only execute locally without ever notifying the server.
Declaration
public bool ClientExclusive
Field Value
Type | Description |
---|---|
System.Boolean |
Container
The entity that contains this action. If the action is innate, this may be the user themselves. This should almost always be non-null.
Declaration
public EntityUid? Container
Field Value
Type | Description |
---|---|
System.Nullable<EntityUid> |
Cooldown
The current cooldown on the action.
Declaration
public (TimeSpan Start, TimeSpan End)? Cooldown
Field Value
Type | Description |
---|---|
System.Nullable<System.ValueTuple<TimeSpan, TimeSpan>> |
Enabled
Whether this action is currently enabled. If not enabled, this action cannot be performed.
Declaration
public bool Enabled
Field Value
Type | Description |
---|---|
System.Boolean |
EntIcon
Declaration
public EntityUid? EntIcon
Field Value
Type | Description |
---|---|
System.Nullable<EntityUid> |
Icon
Icon representing this action in the UI.
Declaration
public SpriteSpecifier Icon
Field Value
Type | Description |
---|---|
Robust.Shared.Utility.SpriteSpecifier |
IconColor
If not null, this color will modulate the action icon color.
Declaration
public Color IconColor
Field Value
Type | Description |
---|---|
Color |
Remarks
This currently only exists for decal-placement actions, so that the action icons correspond to the color of the decal. But this is probably useful for other actions, including maybe changing color on toggle.
IconOn
For toggle actions only, icon to show when toggled on. If omitted, the action will simply be highlighted when turned on.
Declaration
public SpriteSpecifier IconOn
Field Value
Type | Description |
---|---|
Robust.Shared.Utility.SpriteSpecifier |
ItemIconStyle
Determines the appearance of the entity-icon for actions that are enabled via some entity.
Declaration
public ItemActionIconStyle ItemIconStyle
Field Value
Type | Description |
---|---|
ItemActionIconStyle |
Keywords
Keywords that can be used to search for this action in the action menu.
Declaration
public HashSet<string> Keywords
Field Value
Type | Description |
---|---|
HashSet<System.String> |
Priority
Determines the order in which actions are automatically added the action bar.
Declaration
public int Priority
Field Value
Type | Description |
---|---|
System.Int32 |
Sound
If not null, this sound will be played when performing this action.
Declaration
public SoundSpecifier Sound
Field Value
Type | Description |
---|---|
Robust.Shared.Audio.SoundSpecifier |
Temporary
Temporary actions are deleted when they get removed a ActionsComponent.
Declaration
public bool Temporary
Field Value
Type | Description |
---|---|
System.Boolean |
Toggled
The toggle state of this action. Toggling switches the currently displayed icon, see Icon and IconOn.
Declaration
public bool Toggled
Field Value
Type | Description |
---|---|
System.Boolean |
Remarks
The toggle can set directly via SetToggled(Nullable<EntityUid>, Boolean), but it will also be automatically toggled for targeted-actions while selecting a target.
UseDelay
Time interval between action uses.
Declaration
public TimeSpan? UseDelay
Field Value
Type | Description |
---|---|
System.Nullable<TimeSpan> |
Properties
| Improve this Doc View SourceBaseEvent
Declaration
public abstract BaseActionEvent BaseEvent { get; }
Property Value
Type | Description |
---|---|
BaseActionEvent |
EntityIcon
Entity to use for the action icon. If no entity is provided and the Container differs from AttachedEntity, then it will default to using Container
Declaration
public EntityUid? EntityIcon { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<EntityUid> |