Lua Code:
for i=1,4 do
local f = _G["PartyMemberFrame"..i]
f:UnregisterEvent("UNIT_AURA")
local g = CreateFrame("Frame")
g:RegisterEvent("UNIT_AURA")
g:SetScript("OnEvent",function(self,event,a1)
if a1 == f.unit then
RefreshDebuffs(f,a1,20,nil,1)
else
if a1 == f.unit.."pet" then
PartyMemberFrame_RefreshPetDebuffs(f)
end
end
end)
local b = _G[f:GetName().."Debuff1"]
b:ClearAllPoints()
b:SetPoint("LEFT",f,"RIGHT",-7,5)
for j=5,20 do
local l = f:GetName().."Debuff"
local n = l..j
local c = CreateFrame("Frame",n,f,"PartyDebuffFrameTemplate")
c:SetPoint("LEFT",_G[l..(j-1)],"RIGHT")
end
end
for i=1,4 do
local f = _G["PartyMemberFrame"..i]
f:UnregisterEvent("UNIT_AURA")
local g = CreateFrame("Frame")
g:RegisterEvent("UNIT_AURA")
g:SetScript("OnEvent",function(self,event,a1)
if a1 == f.unit then
RefreshBuffs(f,a1,20,nil,1)
end
end)
for j=1,20 do
local l = f:GetName().."Buff"
local n = l..j
local c = CreateFrame("Frame",n,f,"TargetBuffFrameTemplate")
c:EnableMouse(false)
if j == 1 then
c:SetPoint("TOPLEFT",48,-32)
else
c:SetPoint("LEFT",_G[l..(j-1)],"RIGHT",1,0)
end
end
end
So I found this... and it does pretty much what I want it to do, but I want this to be on the ArenaEnemyFrames... I can't figure out how to get it to show for those, I figured changing it to this would work:
Lua Code:
for i=1,4 do
local f = _G["ArenaEnemyFrame"..i]
f:UnregisterEvent("UNIT_AURA")
local g = CreateFrame("Frame")
g:RegisterEvent("UNIT_AURA")
g:SetScript("OnEvent",function(self,event,a1)
if a1 == f.unit then
RefreshDebuffs(f,a1,20,nil,1)
else
if a1 == f.unit.."pet" then
PartyMemberFrame_RefreshPetDebuffs(f)
end
end
end)
local b = _G[f:GetName().."Debuff1"]
b:ClearAllPoints()
b:SetPoint("LEFT",f,"RIGHT",-7,5)
for j=5,20 do
local l = f:GetName().."Debuff"
local n = l..j
local c = CreateFrame("Frame",n,f,"PartyDebuffFrameTemplate")
c:SetPoint("LEFT",_G[l..(j-1)],"RIGHT")
end
end
for i=1,4 do
local f = _G["ArenaEnemyFrame"..i]
f:UnregisterEvent("UNIT_AURA")
local g = CreateFrame("Frame")
g:RegisterEvent("UNIT_AURA")
g:SetScript("OnEvent",function(self,event,a1)
if a1 == f.unit then
RefreshBuffs(f,a1,20,nil,1)
end
end)
for j=1,20 do
local l = f:GetName().."Buff"
local n = l..j
local c = CreateFrame("Frame",n,f,"TargetBuffFrameTemplate")
c:EnableMouse(false)
if j == 1 then
c:SetPoint("TOPLEFT",48,-32)
else
c:SetPoint("LEFT",_G[l..(j-1)],"RIGHT",1,0)
end
end
end
But... I just get a lua error that the value for 'b' is nil.
What I don't understand is, if it's using the PartyDebuffFrameTemplate to size the buffs etc... why can't it just attach that to the ArenaEnemyFrame and update when a new AURA happens?
And from my understanding it's pulling the value for B off of
Lua Code:
local f = _G["ArenaEnemyFrame"..i]
...So why would it cause it to be nil?