Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:SecureActionButtonTemplate
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Action Types == The action the SecureActionButtonTemplate-inheriting frame actually performs is dependent on the value of its ''modified'' type attribute, and possibly additional attributes specific to a type. The table below lists all valid type values and the attributes they use to perform their actions. All relevant attributes can be modified as previously described; and, to the extent possible, all types respect the "unit" attribute for targeting. Generally, variable names are used to refer to the value of the modified attribute sharing their name. {| class="darktable" |+SecureActionButtonTemplate "type" attributes |- ! style="width: 8em" | Type ! style="width: 8em" | Used attributes ! Behavior |- | valign="top" | "actionbar" | valign="top" | "action" | Switches the current action bar depending on the value of the "action" attribute: * A number: switches to a the bar specified by the number. * "increment" or "decrement": move one bar up/down. * "a, b", where a, and b are numeric, switches between bars a and b. |- | valign="top" | "action" | valign="top" | "unit", "action"<br />["actionpage"] | Performs an action specified by the "action" attribute (a number).<br /> If the button:GetID() > 0, paging behavior is supported; see the ActionButton_CalculateAction FrameXML function. |- | valign="top" | "pet" | valign="top" | "unit", "action" | Calls {{api|CastPetAction}}(action, unit); |- | valign="top" | "spell" | valign="top" | "unit", "spell" | Calls {{api|CastSpellByName}}(spell, unit); |- | valign="top" | "item" | valign="top" | "unit"<br />"item" OR<br />["bag", "slot"] | Equips or uses the specified item, as resolved by {{api|SecureCmdItemParse}}. * "item" attribute value may be a macro conditioned string, item name, or "bag slot" string (i.e. "1 3"). * If "item" is nil, the "bag" and "slot" attributes are used; those are deprecated -- use a "bag slot" item string. |- | valign="top" | "macro" | valign="top" | "macro" OR<br />"macrotext" | valign="top" | If "macro" attribute is specified, calls {{api|RunMacro}}(macro, button); otherwise, {{api|RunMacroText}}(macrotext, button); |- | valign="top" | "cancelaura" | valign="top" | "unit"<br />"index" OR<br />"spell"[, "rank"] | Calls either {{api|CancelUnitBuff}}(unit, index) or CancelUnitBuff(unit, spell, rank). The first version '''Note''': the value of the "index" attribute must resolve to nil/false for the "spell", "rank" attributes to be considered. |- | valign="top" | "stop" || || Calls {{api|SpellStopTargeting}}(). |- | valign="top" | "target" | valign="top" | "unit" | Changes target, targets a unit for a spell, or trades unit an item on the cursor.<br /> If "unit" attribute value is "none", your target is cleared. |- | valign="top" | "focus" | valign="top" | "unit" | Calls {{api|FocusUnit}}(unit). |- | valign="top" | "assist" | valign="top" | "unit" | Calls {{api|AssistUnit}}(unit). |- | valign="top" | "mainassist" | valign="top" | "action", "unit" | Performs a main assist status on the unit based on the value of the "action" attribute: * nil or "set": the unit is assigned main assist status. ({{api|SetPartyAssignment}}) * "clear": the unit is stripped main assist status. ({{api|ClearPartyAssignment}}) * "toggle": the main assist status of the unit is inverted. |- | valign="top" | "maintank" | valign="top" | "action", "unit" | As "mainassist", but for main tank status. |- | valign="top" | "click" | valign="top" | "clickbutton" | Calls clickbutton:Click(button) |- | valign="top" | "attribute" | valign="top" | ["attribute-frame",]<br />"attribute-name"<br />"attribute-value" | valign="top" | Calls frame:SetAttribute(attributeName, attributeValue). If "attribute-frame" is not specified, the button itself is assumed. |- | valign="top" | Any other value | valign="top"| "_''type''" | Action depends on the value of the modified ("_" .. type) attribute, or rawget(button, type), in that order. * If the value is a function, it is called with (self, unit, button, actionType) arguments * If the value is a string, a restricted snippet stored in the attribute specified by the value on the button is executed as if it was OnClick. |} Additionally, the "target-item" or "target-bag", "target-slot" attributes allow you to create a button that would target a specific item in your inventory for a spell being cast. This targeting is performed after the main type processing, and only if a spell is currently being targetted. It is therefore possible to create a button that would cast a specific spell on a specific item by setting the relevant attributes. For instance, to disenchant an item in bag 1, slot 1: btn:SetAttribute("type", "spell"); btn:SetAttribute("spell", "Disenchant"); btn:SetAttribute("target-item", "1 1"); -- ("bag slot")
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)