View Single Post
10-08-13, 02:15 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I checked FreebGrid. He is doing
Lua Code:
  1. local setHeaderScale = function(scale)
  2.     for k, v in pairs(ns._Headers) do
  3.         if v then
  4.             v:SetScale(scale)
  5.         end
  6.     end
  7. end
  8.  
  9. function ns:scaleRaid()
  10.     if not ns.db.scaleYes then
  11.         setHeaderScale(ns.db.scale)
  12.         return
  13.     end
  14.  
  15.     local numRaiders = GetNumGroupMembers()
  16.  
  17.     if numRaiders > 25 then
  18.         setHeaderScale(ns.db.scale40)
  19.     elseif numRaiders > 10 then
  20.         setHeaderScale(ns.db.scale25)
  21.     else
  22.         setHeaderScale(ns.db.scale)
  23.     end
  24. end
  25.  
  26. local updateRaid = CreateFrame"Frame"
  27. updateRaid:RegisterEvent("GROUP_ROSTER_UPDATE")
  28. updateRaid:RegisterEvent("PLAYER_ENTERING_WORLD")
  29. updateRaid:SetScript("OnEvent", function(self)
  30.     if(InCombatLockdown()) then
  31.         self:RegisterEvent('PLAYER_REGEN_ENABLED')
  32.     else
  33.         self:UnregisterEvent('PLAYER_REGEN_ENABLED')
  34.  
  35.         ns:scaleRaid()
  36.     end
  37. end)

So basically waiting for out of combat to change the scale of a raid.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote