Kreiri

Rift: LibUnitChange example

Dec 13th, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. -- from Kreiri's Buff Bars
  2.  
  3. local function OnUnitChange(unit, value)
  4.     for _, g in pairs(KBB.groups) do
  5.         if g.settings.unit == unit then
  6.             if (value) then
  7.                 KBB.RescanBuffs(g)
  8.                 if(g.settings.sorts) then g:sortBars() end
  9.                 g:alignBars()
  10.             else
  11.                 g:removeAllBars()
  12.             end
  13.         end
  14.     end
  15. end
  16.  
  17. for k, v in pairs(KBB.units) do
  18.     table.insert(Library.LibUnitChange.Register(k), {function(value) OnUnitChange(k, value) end, addonInfo.toc.Identifier, "OnUnitChange"})
  19. end
  20.  
Advertisement
Add Comment
Please, Sign In to add comment