Module action.Main

Represents an action, which can be an item, macro, or spell.

Functions

ID () Returns the ID of the action.
Type () Returns the type of the action (e.g., "item", "macro", "spell").
Name () Returns the name of the action.
Texture () Returns the texture path of the action's icon.
IsItem () Checks if the action is an item.
IsMacro () Checks if the action is a macro.
IsSpell () Checks if the action is a spell.
IsUsable () Checks if the action is inherently usable.
IsReady (boolean) Checks if the action is ready to be used, considering its usability and action settings.
GetActionSetting () Retrieves the action setting associated with this action from the APL (Action Priority List).
IsUsableByActionSetting (boolean) Checks if the action is usable based on its configured action settings.
CastTime () Returns the cast time of the action.
GCD () Returns the Global Cooldown (GCD) duration of the action.
GetKeybind () Returns the keybind string associated with this action's setting.
GetKeycodes () Returns a table of keycodes corresponding to the action's keybind.
GetCastUnit () Determines the unit that should be the target for this action based on its cast mode and gamepad settings.
API.SetAction (Action) Sets the next action to be performed and updates the last targeted unit.


Functions

ID ()
Returns the ID of the action.

Returns:

    number The action ID.
Type ()
Returns the type of the action (e.g., "item", "macro", "spell").

Returns:

    string The action type.
Name ()
Returns the name of the action.

Returns:

    string The action name.
Texture ()
Returns the texture path of the action's icon.

Returns:

    string The action texture path.
IsItem ()
Checks if the action is an item.

Returns:

    boolean True if the action is an item, false otherwise.
IsMacro ()
Checks if the action is a macro.

Returns:

    boolean True if the action is a macro, false otherwise.
IsSpell ()
Checks if the action is a spell.

Returns:

    boolean True if the action is a spell, false otherwise.
IsUsable ()
Checks if the action is inherently usable. This function always returns true and additional usability checks are performed elsewhere.

Returns:

    boolean Always true.
IsReady (boolean)
Checks if the action is ready to be used, considering its usability and action settings.

Parameters:

  • boolean showNameplateIcon Optional. If true, may affect how cooldowns are evaluated for nameplate display.

Returns:

    boolean True if the action is ready, false otherwise.
GetActionSetting ()
Retrieves the action setting associated with this action from the APL (Action Priority List).

Returns:

    table|nil The action setting table, or nil if no APL or setting is found.
IsUsableByActionSetting (boolean)
Checks if the action is usable based on its configured action settings. Considers enablement, cooldown settings, and time-to-die (TTD) thresholds.

Parameters:

  • boolean showNameplateIcon Optional. If true, may affect how cooldowns are evaluated.

Returns:

    boolean True if the action is usable according to settings, false otherwise.
CastTime ()
Returns the cast time of the action. For generic actions, this is typically 0.

Returns:

    number The cast time in seconds.
GCD ()
Returns the Global Cooldown (GCD) duration of the action. For generic actions, this is typically 0.

Returns:

    number The GCD duration in seconds.
GetKeybind ()
Returns the keybind string associated with this action's setting.

Returns:

    string|nil The keybind string, or nil if not usable or no keybind.
GetKeycodes ()
Returns a table of keycodes corresponding to the action's keybind.

Returns:

    table An array of keycodes.
GetCastUnit ()
Determines the unit that should be the target for this action based on its cast mode and gamepad settings.

Returns:

    Unit.Target|Unit.Focus|Unit.Player|Unit.Mouseover|nil The unit to cast on, or nil if no appropriate unit is found.
API.SetAction (Action)
Sets the next action to be performed and updates the last targeted unit. This is an API-level function, not a method of `Action`.

Parameters:

  • Action action The action object to set as the next action.
generated by LDoc 1.5.0 Last updated 2025-08-07 15:27:51