41 lines
1.5 KiB
Lua
41 lines
1.5 KiB
Lua
PLAYER_ENTERING_WORLD
|
|
function()
|
|
if aura_env.enabled == 1 then
|
|
local r = WeakAuras.regions['julijabutton0'].region
|
|
local b = CreateFrame("Button", "JulijaButton", r, "SecureActionButtonTemplate")
|
|
if aura_env.type:match("spell") then
|
|
b:SetAllPoints()
|
|
b:SetAttribute("unit", aura_env.target)
|
|
b:SetAttribute("spell", aura_env.name)
|
|
b:SetAttribute("type", "spell")
|
|
end
|
|
if aura_env.type:match("macro") then
|
|
b:SetAllPoints()
|
|
b:SetAttribute("macro", aura_env.name)
|
|
b:SetAttribute("type", "macro")
|
|
end
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
INIT
|
|
aura_env.enabled = 0
|
|
aura_env.target = "player" --UnitID; player, focus, target, partyn (where n is the number in order of the party member), raidn (For more elaborate UnitIDs look up UnitID API Wiki thing; NO DYNAMIC INFO); I don't think it works for macros though.... So I've disabled it for macros
|
|
aura_env.type = "spell" --"spell" or "macro" CASE SENSITIVE
|
|
aura_env.name = "Hand of the Protector" --Spell or Macro name CASE SENSITIVE
|
|
|
|
if aura_env.enabled == 1 then
|
|
if not aura_env.type:match("spell") and not aura_env.type:match("macro") then
|
|
print("|cFFFF0000Error 'type' on julijabutton0")
|
|
aura_env.enabled = 0
|
|
end
|
|
if aura_env.name == "" then
|
|
print("|cFFFF0000Error 'name' on julijabutton0")
|
|
end
|
|
if aura_env.target == "" and not aura_env.type:match("macro") then
|
|
print("|cFFFF0000Error 'target' on julijabutton0")
|
|
end
|
|
end
|