Advertisement
Guest User

Untitled

a guest
Jan 13th, 2015
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local myName = ...
  2. local startup = CreateFrame("Frame")
  3. startup:RegisterEvent("ADDON_LOADED")
  4. startup:SetScript("OnEvent",function(self, event, addonName)
  5.     if ( addonName == myName ) then
  6.         LoadAddOn("Blizzard_CompactRaidFrames")
  7.        
  8.         local orderedList = {
  9.             "player",
  10.             "party1",
  11.             "party2",
  12.             "party3",
  13.             "party4",
  14.         }
  15.        
  16.         local oldFunc = CRFSort_Group;
  17.        
  18.         CRFSort_Group = function(a, b)
  19.             if IsInRaid() then
  20.                 return oldFunc(a,b)
  21.             end
  22.            
  23.             for i, n in ipairs(orderedList) do
  24.                 if ( UnitIsUnit(a,n) or UnitIsUnit(b,n) ) then
  25.                     return UnitIsUnit(a,n)
  26.                 end
  27.             end
  28.            
  29.             return a < b
  30.         end
  31.        
  32.         CompactRaidFrameContainer.flowSortFunc = CRFSort_Group
  33.        
  34.         startup:UnregisterAllEvents()
  35.     end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement