Thread Tools Display Modes
08-09-14, 04:49 AM   #1
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
toggle aura with a custom SecureActionButtonTemplate button (like Stancebar)

i want to recreate the hunter aspect bar for wod using custom buttons based on SecureActionButtonTemplate

currently i'm using this to cast a spell on left click and cancel the aura on rightclick:

Lua Code:
  1. button:SetAttribute("type", "spell");
  2. button:SetAttribute("spell", spellId);
  3. button:SetAttribute("type2", "cancelaura");
  4. button:SetAttribute("unit2", "player");
  5. button:SetAttribute("spell2", spellName);
  6. button:RegisterForClicks("AnyUp");

is there a way to change the behavior of my buttons to act more like the real stancebar, that means left click should cancel the aura if it is already active and casts it if not?
  Reply With Quote
08-09-14, 09:39 AM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I would say 'no'. Except you could rewrite the buttons attributes to cancleaura if the player casts the aura and vice vesa. But this is resticted to out of combat. :/

[e] Maybe there is a kind of macro that works this way? I'm not that familar with macros.

Last edited by Duugu : 08-09-14 at 09:42 AM.
  Reply With Quote
08-09-14, 12:46 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Check this out: http://www.wowinterface.com/download...ellToggle.html
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-09-14, 02:24 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
I'm not sure I understand the question, if you try and cast an active aspect again on the beta it cancels itself.

You shouldn't need to handle canceling the aura at all.
  Reply With Quote
08-10-14, 05:07 AM   #5
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
Originally Posted by Seerah View Post
Thanks, Spell Toggle is using the spell name for the spell attribute (I was using the spell ID).

When I change the spell ID to the spell name it works as expected
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » toggle aura with a custom SecureActionButtonTemplate button (like Stancebar)

Thread Tools
Display Modes

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