Type Parameters

Hierarchy

Properties

bindable?: default | ((using: IUsableActionUsing<REQUIREMENTS>) => undefined | default)

The bindable assigned to this action, for use in action context menus (ie, right clicking on the world or an item.) Allows for a dynamically generated bindable based on what this action is using — item, doodad, etc.

clientSide?: true

Marks this usable action as only executable client-side. This disables support for "auto-use" in action slots.

displayLevel?: ActionDisplayLevel | ((using: IUsableActionPossibleUsing) => undefined | ActionDisplayLevel)

The contexts this action appears in.

  • "Always" means whenever an action of this type is shown, it will be. For example, the "item actions" menu.
  • "Direct" means whenever an action of this type is applicable to given objects, it will be. For example, a specific item's menu.
  • "Never" means it will never be shown in menus. This results in an action which is executable but never appears in menus.
forceDisplayWhenEmpty?: true
icon?: SupplierOr<false | UsableActionIconReference, [using: IUsableActionPossibleUsing, action: default<REQUIREMENTS, IUsableActionDefinition<REQUIREMENTS>>, context: UsableActionDisplayContext]>

The icon this action should have, if any.

iconLocationOnItem?: ItemDetailIconLocation

Where the icon should appear, when slotted with an item. Defaults to bottom right.

Generally, top left means "something else interacting with the slotted item" rather than "the slotted item interacting with something."
For example, "Harvest" shows in bottom right, because it's using this tool to harvest. Whereas "Repair With X" shows in top left, because it's repairing this tool.

id?: string | number
inspectTypes?: InspectType[]
onlySlotItemQuality?: true

Marks this usable action as, when slotted in the action bar on an item, the item should be ignored and instead the quality should be used. Compatible with onlySlotItemType

onlySlotItemType?: true

Marks this usable action as, when slotted in the action bar on an item, the item should be ignored and instead the type should be used. Compatible with onlySlotItemQuality

priority?: number | ((using: IUsableActionPossibleUsing) => undefined | number)

Controls the display order of this action compared to other actions. Generally you want to leave this as 0 (default) and just register your action in the correct place. Priority can be generated dynamically based on the given objects — item, doodad, etc.

Higher priority === appears first.
Lower priority === appears last.

slottable?: boolean

Whether this action can be slotted in the action bar. Defaults to true.

translate?: ((translator: UsableActionTranslator) => UsableActionTranslator)

Type declaration

useHintAction?: ActionType

A hint for the inspection system that this UA is internally using a specific action. Use tooltip filtering checks this.

Methods

  • Executes this action. Generally, this is where you want to execute an internal action registered with @Register.action, as internal actions are called on all sides, rather than only clientside*.

    *Warning: While usable actions appear to only ever be client-side, they're not always. The "auto-use" feature for action slots results in actions being executed only on the server's side. If you try to perform a client-side UI function here, such as showing a prompt, and a player puts the action in a "auto-use" action slot, the host will receive the prompt instead!

    If you'd like to execute some things on clientside, you can check if the player is the local player by checking if (player.asLocalPlayer), or ensure that this action is only executed clientside by setting clientSide: true, which disables support for the "auto-use" feature.

    Parameters

    Returns any

  • A handler for what this action will highlight when hovered with the mouse.

    Parameters

    Returns any

  • Whether this action is "applicable" given this player and these "provided" objects.

    Parameters

    • player: default

      The player executing this action. This isn't always the local player!

    • using: IUsableActionPossibleUsing

      What the player is using — items, doodads, etc.

    Returns boolean

  • Marks this "action" as a submenu container instead of an executable. Is a generator for the submenu.

    Parameters

    • registrar: default

      The registrar that submenu actions should be appended to.

    • using: IUsableActionUsing<REQUIREMENTS>

      What this action is using. Item, doodad, etc.

    Returns void | default

  • Parameters

    Returns any

Generated using TypeDoc