Masque

API / ButtonData

ButtonData is a definition table for the default layers of a button. Some button add-ons use built-in templates to create their buttons which causes them to automatically inherit some of the layers associated with their button type. Additionally, these add-ons sometimes have their buttons registered in the global name space. In this case, it isn't necessary for the add-on to pass the layers via the ButtonData table since Masque will try to locate each layer based on the built-in naming convention.

However, there are some cases when an author doesn't want to pollute the global name space and/or their buttons are created anonymously. This is where the ButtonData table comes in. Passing the button's layers in this table allows Masque to access those layers so that they can be skinned.


Note: Regardless of the method used to create the buttons, Masque gains a slight performance boost when using the ButtonData table since it doesn't have to search for every layer of every button.


Example

In the example below, you'll see that each layer is defined with the key as the string name of the layer and the value as a table. This table is the layer's object table.

local ButtonData = {
	FloatingBG = {...},
	Icon = {...},
	Cooldown = {...},
	Flash = {...},
	Pushed = {...},
	Normal = {...},
	Disabled = {...},
	Checked = {...},
	Border = {...},
	AutoCastable = {...},
	Highlight = {...},
	HotKey = {...},
	Count = {...},
	Name = {...},
        Duration = {...},
	AutoCast = {...},
}

Note: If one of the layers is set to nil, Masque will attempt to find the layer by using the naming convention provided by the default UI. If the layer is set to false, the layer will be ignored completely.


Layer Information

The following is a list of layers, their purpose and the value they default to if set to nil in the ButtonData table. Note that any unrecognized layer will be ignored.


FloatingBG

The background texture that appears on multi-bar action buttons.

Default

_G[Button:GetName().."FloatingBG"]


Icon

The spell or skill icon for the button.

Default

_G[Button:GetName().."Icon"]


Cooldown

The cool down animation frame for the button.

Default

_G[Button:GetName().."Cooldown"]


Flash

The texture that "flashes" when an ability is in an auto-attack state.

Default

_G[Button:GetName().."Flash"]


Pushed

The texture shown when the button is pressed.

Default

Button:GetPushedTexture()


Normal

The default state texture. Note that this is not the Border layer, despite the fact that it typically appears as a "border" around the icon.

Default

Button:GetNormalTexture()


Disabled

The texture shown when a button is disabled

Default

Button:GetDisabledTexture()


Checked

The texture shown when a button is in the "checked" state.

Default

Button:GetCheckedTexture()


Border

The border indicator texture that is shown when the button slot contains an equipped item or debuff.

Default

_G[Button:GetName().."Border"]


AutoCastable

The texture that's shown when and ability can be toggled on and off.

Default

_G[Button:GetName().."AutoCastable"]


Highlight

The texture shown when the cursor is over a button.

Default

Button:GetHighlightTexture()


HotKey

The key binding text.

Default

G[Button:GetName().."HotKey"]


Count

The item count text.

Default

_G[Button:GetName().."Count"]


Name

The macro name text.

Default

_G[Button:GetName().."Name"]


Duration

The duration text displayed on buff and debuff buttons.

Default

_G[Button:GetName().."Duration"]


AutoCast

The animation frame that's shown when an automatic ability is enabled.

Default

_G[Button:GetName().."Shine"]