Thread Tools Display Modes
12-21-06, 01:57 PM   #1
Nief
A Murloc Raider
Join Date: Nov 2006
Posts: 4
Transforming Macros into Buttonattributes - How?

Hi,

I am still struggeling in understanding the securebutton's attributes. Since writing macros seems easier (at least to me), maybe someone can provide some examples how to translate macros into attributes.

If I got it right, a common actionbar button has the following attributes:

Button:SetAttribute("type", "action"); -- perfom an action from an actionslot on left click
Button:SetAttribute("action", 1); -- apply action placed in actionslot 1
Button:SetAttribute("*unit*", "player"); -- apply to target

Assuming, that Moonfire is placed in actionslot 1, the behavior of the macro

/cast [target=targettarget] Moonfire

can be obtained by setting the unit attribute to targettarget:

Button:SetAttribute("type", "action"); -- perfom an action from an actionslot on left click
Button:SetAttribute("action", 1); -- apply action placed in actionslot 1
Button:SetAttribute("*unit*", "targettarget"); -- apply to targettarget

But what about more complicated macros like

/cast [target=targettarget,exists,harm] Moonfire; [exists] Moonfire

or

/cast [target=mouseover,exists,help] Rejuvenation; [target=player] Rejuvenation

How do I add a different behavior for right-clicks, eg. to choose the focus?

I think at least everything possible with a macro should be possible with attributes?! I would be very thankful if someone was able to provide and describe some more examples.

Nief

Last edited by Nief : 12-21-06 at 03:15 PM.
  Reply With Quote
12-21-06, 02:33 PM   #2
Nief
A Murloc Raider
Join Date: Nov 2006
Posts: 4
I found out that

Button:SetAttribute("type", "action");
Button:SetAttribute("action", 1);
Button:SetAttribute("unit", "target"); -- apply to target
Button:SetAttribute("type2", "action");
Button:SetAttribute("action2", 1);
Button:SetAttribute("unit2", "focus"); -- apply to focus

applies the action to target or focus depending on left or rightclick.

Nief
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Transforming Macros into Buttonattributes - How?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off