Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-12-14, 10:42 PM   #1
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
UnitBuff help

So finally making aura for my group frames after I found what seemed like a great example but I'm a bit stuck. The example I found uses (select(4,UnitBuff("player","AURANAME))) So I think I can use "group" but obviously it doesn't work. Do I have to repeat the event checkfor party and raid? I'm using ouf for the raid frames


Indicater script
Lua Code:
  1. if cfg.indicators.enable then
  2.         indicatorframe = CreateFrame("Frame","IndicatorFrame",self)
  3.         indicatorframe:SetPoint('TOPLEFT')
  4.         indicatorframe:SetPoint('BOTTOMRIGHT')
  5.         indicatorframe:EnableMouse(0)--disable mouse
  6.  
  7.         --Build the indicator
  8.         indicator1 = CreateFrame(nil, 'OVERLAY')
  9.         indicator1:SetPoint("TOPLEFT",indicatorframe,0,0)
  10.         indicator1:SetWidth(5)
  11.         indicator1:SetHeight(5)
  12.         indicator1:SetBackdrop({bgFile="Interface\\Buttons\\WHITE8x8"})
  13.  
  14.         indicator2 = CreateFrame(nil, 'OVERLAY')
  15.         indicator2:SetPoint("TOPRIGHT",indicatorframe,0,0)
  16.         indicator2:SetWidth(5)
  17.         indicator2:SetHeight(5)
  18.         indicator2:SetBackdrop({bgFile="Interface\\Buttons\\WHITE8x8"})
  19.  
  20.         indicator3 = CreateFrame(nil, 'OVERLAY')
  21.         indicator3:SetPoint("BOTTOMLEFT",indicatorframe,0,0)
  22.         indicator3:SetWidth(5)
  23.         indicator3:SetHeight(5)
  24.         indicator3:SetBackdrop({bgFile="Interface\\Buttons\\WHITE8x8"})
  25.  
  26.         indicator4 = CreateFrame(nil, 'OVERLAY')
  27.         indicator4:SetPoint("BOTTOMRIGHT",indicatorframe,0,0)
  28.         indicator4:SetWidth(5)
  29.         indicator4:SetHeight(5)
  30.         indicator4:SetBackdrop({bgFile="Interface\\Buttons\\WHITE8x8"})
  31.  
  32.         --Show Hide
  33.         indicatorframe:SetScript("OnEvent", function(self, OnEvent)
  34.             if event == "UNIT_AURA" then
  35.                 indicator1 = (select(4,UnitBuff("party",cfg.indicators.aura1)))
  36.             elseif event == "UNIT_AURA" then
  37.                 indicator2 = (select(4,UnitBuff("party",cfg.indicators.aura2)))
  38.             elseif event == "UNIT_AURA" then
  39.                 indicator3 = (select(4,UnitBuff("party",cfg.indicators.aura3)))
  40.             elseif event == "UNIT_AURA" then
  41.                 indicator4 = (select(4,UnitBuff("party",cfg.indicators.aura4)))
  42.             elseif indicator1 == nil then
  43.                 indicator1:Hide()
  44.             elseif indicator2 == nil then
  45.                 indicator2:Hide()
  46.             elseif indicator3 == nil then
  47.                 indicator3:Hide()
  48.             elseif indicator4 == nil then
  49.                 indicator4:Hide()
  50.             end
  51.         end)
  52.         indicator1:RegisterEvent("UNIT_AURA")
  53.         indicator2:RegisterEvent("UNIT_AURA")
  54.         indicator3:RegisterEvent("UNIT_AURA")
  55.         indicator4:RegisterEvent("UNIT_AURA")
  56.     end

SVN is currently down for some reason can't post to it, so here's pastebin
config
http://pastebin.com/d32JQuK8
group frame code
http://pastebin.com/SJEzm9xn
__________________
Tweets YouTube Website
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » UnitBuff help


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