Class Models.Macro

The macro class maps macro information and allow in game macro updates.

Methods

models.macro:exists () Determines whether this macro exists.
models.macro:save () Saves the macro, returning the macro id.
models.macro:setBody (value) Sets the macro body.
models.macro:setIcon (value) Sets the macro icon.
models.macro:setName (value) Sets the macro name.

Metamethods

models.macro:__construct (name) Macro constructor.


Methods

models.macro:exists ()
Determines whether this macro exists.

Returns:

    boolean Whether the macro exists
models.macro:save ()
Saves the macro, returning the macro id.

If the macro, identified by its name, doesn't exist yet, it will be created.

It's important to mention that this whole Macro class can have weird behavior if it tries to save() a macro with dupicated names. Make sure this method is called for unique names.

Future implementations may fix this issue, but as long as it uses unique names, this model will work as expected.

Returns:

    integer The macro id
models.macro:setBody (value)
Sets the macro body.

The macro's body is the code that will be executed when the macro's triggered.

If the value is an array, it's considered a multiline body, and lines will be separated by a line break.

Parameters:

  • value array[string] or string The macro's body

Returns:

    Models.Macro self The current instance for method chaining
models.macro:setIcon (value)
Sets the macro icon.

Parameters:

  • value integer or string The macro's icon texture id

Returns:

    Models.Macro self The current instance for method chaining
models.macro:setName (value)
Sets the macro name.

This is the macro's identifier, which means the one World of Warcraft API will use when accessing the game's macro.

Parameters:

  • value string The macro's name

Returns:

    Models.Macro self The current instance for method chaining

Metamethods

models.macro:__construct (name)
Macro constructor.

Parameters:

  • name string The macro's name
generated by LDoc 1.5.0 Last updated 2024-09-11 16:27:53