WoWInterface SVN mikma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /Voodoo
    from Rev 546 to Rev 547
    Reverse comparison

Rev 546 → Rev 547

Voodoo.lua
10,6 → 10,8
local button = CreateFrame("Button", "Voodoo", UIParent, "SecureActionButtonTemplate, ActionButtonTemplate")
button:SetPoint("CENTER",UIParent)
 
local wait,timer = 1
 
local function ChangeButtonAttributes(texture,type,spell,target)
if texture then
_G[button:GetName().."Icon"]:SetTexture(texture)
151,16 → 153,20
end)
 
local function onUpdate(self,elapsed)
if VoodooDB[GetActiveTalentGroup()]["spell"] and VoodooDB[GetActiveTalentGroup()]["target"] then
if IsSpellInRange(VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"]) == 1 or IsItemInRange(VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"]) == 1 then
frame:SetBackdropBorderColor(0,1,0,1)
elseif string.lower(VoodooDB[GetActiveTalentGroup()]["target"]) == string.lower(UnitName("player")) then
frame:SetBackdropBorderColor(1,1,0,1)
else
frame:SetBackdropBorderColor(1,0,0,1)
timer = timer + elapsed
if timer >= wait then
if VoodooDB[GetActiveTalentGroup()]["spell"] and VoodooDB[GetActiveTalentGroup()]["target"] then
if IsSpellInRange(VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"]) == 1 or IsItemInRange(VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"]) == 1 then
frame:SetBackdropBorderColor(0,1,0,1)
elseif string.lower(VoodooDB[GetActiveTalentGroup()]["target"]) == string.lower(UnitName("player")) then
frame:SetBackdropBorderColor(1,1,0,1)
else
frame:SetBackdropBorderColor(1,0,0,1)
end
else
frame:SetBackdropBorderColor(1,1,1,1)
end
else
frame:SetBackdropBorderColor(1,1,1,1)
timer = 0
end
end
 
201,6 → 207,14
CheckCooldown()
end
 
function frame:PLAYER_REGEN_DISABLED()
wait = 0.3
end
 
function frame:PLAYER_REGEN_ENABLED()
wait = 1
end
 
function frame:PLAYER_LOGIN()
if not VoodooDB then VoodooDB = {} end
if not VoodooDB[GetActiveTalentGroup()] then VoodooDB[GetActiveTalentGroup()] = {} end
216,4 → 230,6
SetPosition()
frame:RegisterEvent("PLAYER_TALENT_UPDATE")
frame:RegisterEvent("SPELL_UPDATE_COOLDOWN")
frame:RegisterEvent("PLAYER_REGEN_DISABLED")
frame:RegisterEvent("PLAYER_REGEN_ENABLED")
end
\ No newline at end of file
Voodoo.toc
1,6 → 1,7
## Interface: 30200
## Title: Voodoo
## Notes: Poke the button to cast spells on your target!
## Version: 1.1
## SavedVariablesPerCharacter: VoodooDB
 
Voodoo.lua