Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-08-21, 07:45 PM   #1
Jamien
A Defias Bandit
Join Date: Jan 2021
Posts: 2
Secureactionbuttontemplate with a variable attribute

I've made a quick WeakAura for tracking buffs/debuffs for myself and the other tank in our raid, with a button that pops up on Readycheck if there is no focus.
Left clicking the button targets the other tank, right click focuses.

At present I have this (which works fine, but only on our mains):

Code:
local region = aura_env.region
local b = CreateFrame("Button", "FocusBtn", region, "SecureActionButtonTemplate")
b:RegisterForClicks("LeftButtonUp","RightButtonUp")
b:SetAllPoints(region)

if UnitName("player") == "Niian" then
    b:SetAttribute("*type1", "macro")
    b:SetAttribute("macrotext", "/target Aswm")
end

if UnitName("player") == "Aswm" then
    b:SetAttribute("*type1", "macro")
    b:SetAttribute("macrotext", "/target Niian")
end

b:SetAttribute("*type2","focus")
I can easily enough scan through the raid and create a variable with the name of the other tank, but is there a way that I can then use this variable in a secureactionbuttontemplate button? I've tried a few times but haven't been able to get it to work.
Thanks!
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Secureactionbuttontemplate with a variable attribute


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