Thread Tools Display Modes
Prev Previous Post   Next Post Next
08-18-15, 11:47 AM   #1
Akiu
A Defias Bandit
Join Date: Aug 2015
Posts: 2
ArenaEnemyFrame buff display

Lua Code:
  1. for i=1,4 do
  2.         local f = _G["PartyMemberFrame"..i]
  3.         f:UnregisterEvent("UNIT_AURA")
  4.         local g = CreateFrame("Frame")
  5.         g:RegisterEvent("UNIT_AURA")
  6.         g:SetScript("OnEvent",function(self,event,a1)
  7.                 if a1 == f.unit then
  8.                         RefreshDebuffs(f,a1,20,nil,1)
  9.                 else
  10.                         if a1 == f.unit.."pet" then
  11.                                 PartyMemberFrame_RefreshPetDebuffs(f)
  12.                         end
  13.                 end
  14.         end)
  15.         local b = _G[f:GetName().."Debuff1"]
  16.         b:ClearAllPoints()
  17.         b:SetPoint("LEFT",f,"RIGHT",-7,5)
  18.         for j=5,20 do
  19.                 local l = f:GetName().."Debuff"
  20.                 local n = l..j
  21.                 local c = CreateFrame("Frame",n,f,"PartyDebuffFrameTemplate")
  22.                 c:SetPoint("LEFT",_G[l..(j-1)],"RIGHT")
  23.         end
  24. end
  25.  
  26. for i=1,4 do
  27.         local f = _G["PartyMemberFrame"..i]
  28.         f:UnregisterEvent("UNIT_AURA")
  29.         local g = CreateFrame("Frame")
  30.         g:RegisterEvent("UNIT_AURA")
  31.         g:SetScript("OnEvent",function(self,event,a1)
  32.                 if a1 == f.unit then
  33.                         RefreshBuffs(f,a1,20,nil,1)
  34.                 end
  35.         end)
  36.         for j=1,20 do
  37.                 local l = f:GetName().."Buff"
  38.                 local n = l..j
  39.                 local c = CreateFrame("Frame",n,f,"TargetBuffFrameTemplate")
  40.                 c:EnableMouse(false)
  41.                 if j == 1 then
  42.                         c:SetPoint("TOPLEFT",48,-32)
  43.                 else
  44.                         c:SetPoint("LEFT",_G[l..(j-1)],"RIGHT",1,0)
  45.                 end
  46.         end
  47. 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:
  1. for i=1,4 do
  2.  local f = _G["ArenaEnemyFrame"..i]
  3.  f:UnregisterEvent("UNIT_AURA")
  4.  local g = CreateFrame("Frame")
  5.  g:RegisterEvent("UNIT_AURA")
  6.  g:SetScript("OnEvent",function(self,event,a1)
  7.  if a1 == f.unit then
  8.  RefreshDebuffs(f,a1,20,nil,1)
  9.  else
  10.  if a1 == f.unit.."pet" then
  11.  PartyMemberFrame_RefreshPetDebuffs(f)
  12.  end
  13.  end
  14.  end)
  15.  local b = _G[f:GetName().."Debuff1"]
  16.  b:ClearAllPoints()
  17.  b:SetPoint("LEFT",f,"RIGHT",-7,5)
  18.  for j=5,20 do
  19.  local l = f:GetName().."Debuff"
  20.  local n = l..j
  21.  local c = CreateFrame("Frame",n,f,"PartyDebuffFrameTemplate")
  22.  c:SetPoint("LEFT",_G[l..(j-1)],"RIGHT")
  23.  end
  24. end
  25.  
  26. for i=1,4 do
  27.  local f = _G["ArenaEnemyFrame"..i]
  28.  f:UnregisterEvent("UNIT_AURA")
  29.  local g = CreateFrame("Frame")
  30.  g:RegisterEvent("UNIT_AURA")
  31.  g:SetScript("OnEvent",function(self,event,a1)
  32.  if a1 == f.unit then
  33.  RefreshBuffs(f,a1,20,nil,1)
  34.  end
  35.  end)
  36.  for j=1,20 do
  37.  local l = f:GetName().."Buff"
  38.  local n = l..j
  39.  local c = CreateFrame("Frame",n,f,"TargetBuffFrameTemplate")
  40.  c:EnableMouse(false)
  41.  if j == 1 then
  42.  c:SetPoint("TOPLEFT",48,-32)
  43.  else
  44.  c:SetPoint("LEFT",_G[l..(j-1)],"RIGHT",1,0)
  45.  end
  46.  end
  47. 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:
  1. local f = _G["ArenaEnemyFrame"..i]

...So why would it cause it to be nil?
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » ArenaEnemyFrame buff display


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off