WoWInterface SVN mikma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /Voodoo
    from Rev 550 to Rev 551
    Reverse comparison

Rev 550 → Rev 551

Voodoo.lua
10,7 → 10,7
local button = CreateFrame("Button", "Voodoo", UIParent, "SecureActionButtonTemplate, ActionButtonTemplate")
button:SetPoint("CENTER",UIParent)
 
local wait,timer = 1,0
local wait,timer = 0.3,0
 
local function ChangeButtonAttributes(texture,actiontype,spell,target)
if texture then
126,7 → 126,7
 
frame:SetBackdrop(GameTooltip:GetBackdrop())
frame:SetBackdropColor(1,0,0,0.5)
frame:SetBackdropBorderColor(0,0,0,1)
frame:SetBackdropBorderColor(1,1,1,1)
frame:RegisterForDrag("LeftButton")
frame:SetMovable(true)
frame:EnableMouse(true)
155,23 → 155,17
local function onUpdate(self,elapsed)
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
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,1,1,1)
frame:SetBackdropBorderColor(1,0,0,1)
end
timer = 0
end
end
 
frame:SetScript("OnUpdate", onUpdate)
 
local function SetPosition()
frame:SetPoint("TOPLEFT",Voodoo,"TOPLEFT",-7,7)
frame:SetPoint("BOTTOMLEFT",Voodoo,"BOTTOMLEFT",-7,-7)
208,11 → 202,17
end
 
function frame:PLAYER_REGEN_DISABLED()
wait = 0.3
if VoodooDB[GetActiveTalentGroup()]["spell"] and VoodooDB[GetActiveTalentGroup()]["target"] then
frame:SetScript("OnUpdate", onUpdate)
end
end
 
function frame:PLAYER_REGEN_ENABLED()
wait = 1
local activeScript = frame:GetScript("OnUpdate")
if activeScript then
frame:SetScript("OnUpdate", nil)
frame:SetBackdropBorderColor(1,1,1,1)
end
end
 
function frame:PLAYER_LOGIN()