WoWInterface SVN mikma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /Voodoo
    from Rev 548 to Rev 549
    Reverse comparison

Rev 548 → Rev 549

Voodoo.lua
12,14 → 12,14
 
local wait,timer = 1
 
local function ChangeButtonAttributes(texture,spelltype,spell,target)
local function ChangeButtonAttributes(texture,actiontype,spell,target)
if texture then
_G[button:GetName().."Icon"]:SetTexture(texture)
end
if spelltype and spell then
if actiontype and spell then
button:SetAttribute("unit",target)
button:SetAttribute("type",spelltype)
button:SetAttribute(spelltype,spell)
button:SetAttribute("type",actiontype)
button:SetAttribute(actiontype,spell)
end
if target then
editbox:SetText(target)
28,18 → 28,18
 
local function ChangeAction()
if InCombatLockdown() then return end
local spelltype,itemID = GetCursorInfo()
if spelltype == "spell" or "item" then
VoodooDB[GetActiveTalentGroup()]["spelltype"] = spelltype
if spelltype == "spell" then
VoodooDB[GetActiveTalentGroup()]["spell"] = select(1,GetSpellName(itemID,spelltype))
local actiontype,itemID = GetCursorInfo()
if actiontype == "spell" or "item" then
VoodooDB[GetActiveTalentGroup()]["actiontype"] = actiontype
if actiontype == "spell" then
VoodooDB[GetActiveTalentGroup()]["spell"] = select(1,GetSpellName(itemID,actiontype))
VoodooDB[GetActiveTalentGroup()]["texture"] = GetSpellTexture(VoodooDB[GetActiveTalentGroup()]["spell"])
elseif spelltype == "item" then
elseif actiontype == "item" then
VoodooDB[GetActiveTalentGroup()]["spell"] = select(1,GetItemInfo(itemID))
VoodooDB[GetActiveTalentGroup()]["texture"] = select(10,GetItemInfo(itemID))
end
if editbox:GetText() ~= "" then VoodooDB[GetActiveTalentGroup()]["target"] = editbox:GetText() end
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["spelltype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["actiontype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
return ClearCursor()
end
end
100,7 → 100,7
return
end
VoodooDB[GetActiveTalentGroup()]["target"] = self:GetText() ~= "" and self:GetText() or nil
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["spelltype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["actiontype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
self:ClearFocus()
end)
editbox:SetScript("OnEscapePressed", function(self)
109,14 → 109,14
return
end
VoodooDB[GetActiveTalentGroup()]["target"] = self:GetText() ~= "" and self:GetText() or nil
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["spelltype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["actiontype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
self:ClearFocus()
end)
editbox:SetScript("OnEditFocusGained", function(self)
if InCombatLockdown() then return end
if IsShiftKeyDown() and UnitExists("target") then
VoodooDB[GetActiveTalentGroup()]["target"] = UnitName("target")
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["spelltype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["actiontype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
self:SetText(VoodooDB[GetActiveTalentGroup()]["target"])
self:ClearFocus()
else
191,10 → 191,10
local function GetSpellData()
if not VoodooDB[GetActiveTalentGroup()] then VoodooDB[GetActiveTalentGroup()] = {} end
local texture = VoodooDB[GetActiveTalentGroup()]["texture"] and VoodooDB[GetActiveTalentGroup()]["texture"] or "Interface\\Icons\\INV_Misc_QuestionMark"
local spelltype = VoodooDB[GetActiveTalentGroup()]["spelltype"] and VoodooDB[GetActiveTalentGroup()]["spelltype"] or nil
local actiontype = VoodooDB[GetActiveTalentGroup()]["actiontype"] and VoodooDB[GetActiveTalentGroup()]["actiontype"] or nil
local spell = VoodooDB[GetActiveTalentGroup()]["spell"] and VoodooDB[GetActiveTalentGroup()]["spell"] or nil
local target = VoodooDB[GetActiveTalentGroup()]["target"] and VoodooDB[GetActiveTalentGroup()]["target"] or ""
return texture,spelltype,spell,target
return texture,actiontype,spell,target
end
 
function frame:SPELL_UPDATE_COOLDOWN()
202,8 → 202,8
end
 
function frame:PLAYER_TALENT_UPDATE()
local texture,spelltype,spell,target = GetSpellData()
ChangeButtonAttributes(texture,spelltype,spell,target)
local texture,actiontype,spell,target = GetSpellData()
ChangeButtonAttributes(texture,actiontype,spell,target)
CheckCooldown()
end
 
219,7 → 219,7
if not VoodooDB then VoodooDB = {} end
if not VoodooDB[GetActiveTalentGroup()] then VoodooDB[GetActiveTalentGroup()] = {} end
if VoodooDB[GetActiveTalentGroup()]["spell"] and VoodooDB[GetActiveTalentGroup()]["texture"] then
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["spelltype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
ChangeButtonAttributes(VoodooDB[GetActiveTalentGroup()]["texture"],VoodooDB[GetActiveTalentGroup()]["actiontype"],VoodooDB[GetActiveTalentGroup()]["spell"],VoodooDB[GetActiveTalentGroup()]["target"])
end
editbox:SetText(VoodooDB[GetActiveTalentGroup()]["target"] and VoodooDB[GetActiveTalentGroup()]["target"] or "")
if VoodooDB.lock then