WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Classic - AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=180)
-   -   Addon to increase the number of buffs per row on UNIT FRAMES (https://www.wowinterface.com/forums/showthread.php?t=59269)

frostimus 10-21-22 12:06 AM

Addon to increase the number of buffs per row on UNIT FRAMES
 
As title states, would like to know if there are any addons that increase the number of buffs/debuffs per row on UNIT FRAMES, not the player's.

This discontinued addon is basically what I'm looking for:
https://www.wowinterface.com/downloa...uffs.html#info

If there is no addon that does this while preserving the Blizzard UI, is it possible to update the aforementioned addon to work in WOTLK? Thanks.

SDPhantom 10-22-22 07:46 PM

I was going back and forth with someone that wanted the same effect. Unfortunately, the code I ended up writing for them was updated for use in Dragon Flight. I'll see if I can find the Shadowlands version and adjust it for WotLK.

SDPhantom 10-22-22 09:38 PM

This is what I've come up with. I ended up rewriting it from scratch while using the newer version's position calculation as it was cleaner and I had already made it configurable.

Lua Code:
  1. --  Config Constants
  2. local Aura_Size=21;
  3. local Aura_Spacing=2;
  4. local Aura_ShortCols=4;--   Buffs per short row
  5. local Aura_ShortRows=2;--   Number of shortened rows
  6. local Aura_NormalCols=6;--  Buffs per remaining rows
  7.  
  8. --  Calculated Constants
  9. local Aura_ShortPadCols=Aura_NormalCols-Aura_ShortCols;
  10. local Aura_GridSize=Aura_Size+Aura_Spacing;
  11.  
  12. local function ReanchorAuras(self,auratype,container,prevrows)
  13.     prevrows=prevrows or 0;
  14.     local nameformat=("%s%s%%d"):format(self:GetName(),auratype);
  15.  
  16.     local point,relframe,relpoint,offsetx,offsety;
  17.     local rowcount,lastrowanchor=prevrows,nil;
  18.     for i=1,math.huge do--  Trick into running an infinite counter loop
  19.         local auraframe=_G[nameformat:format(i)];
  20.         if not (auraframe and auraframe:IsShown()) then return rowcount,lastrowanchor; end--    We're done, return here
  21.  
  22.         if i>1 then
  23.             local posindex=i-1; if not self.buffsOnTop and prevrows<Aura_ShortRows then
  24.                 posindex=posindex+math.min(math.floor(posindex/Aura_ShortCols),Aura_ShortRows-prevrows)*Aura_ShortPadCols;
  25.             end
  26.  
  27.             local x,y=posindex%Aura_NormalCols,math.floor(posindex/Aura_NormalCols);
  28.             auraframe:SetPoint(point,relframe,relpoint
  29.                 ,x*Aura_GridSize+offsetx
  30.                 ,(self.buffsOnTop and 1 or -1)*y*Aura_GridSize+offsety
  31.             );
  32.  
  33.             if x==0 then
  34.                 rowcount,lastrowanchor=prevrows+y+1,auraframe;
  35.                 container:SetPoint(relpoint,auraframe,relpoint,0,self.buffsOnTop and 1 or -1);
  36.             end
  37.         else point,relframe,relpoint,offsetx,offsety=auraframe:GetPoint(1); end
  38.  
  39. --      Note: DebuffType border scales with size, but Stealable border doesn't
  40.         auraframe:SetSize(Aura_Size,Aura_Size);
  41.         local stealborder=_G[nameformat:format(i).."Stealable"]; if stealborder then
  42.             local size=math.floor(Aura_Size*8/7);
  43.             stealborder:SetSize(size,size);
  44.         end
  45.     end
  46. end
  47.  
  48. hooksecurefunc("TargetFrame_UpdateAuras",function(self)
  49.     local rowcount,anchor1,anchor2=0,nil,nil;
  50.  
  51.     if UnitIsFriend("player",self.unit) then
  52.         rowcount,anchor1=ReanchorAuras(self,"Buff",self.buffs,rowcount);
  53.         rowcount,anchor2=ReanchorAuras(self,"Debuff",self.debuffs,rowcount);
  54.     else
  55.         rowcount,anchor1=ReanchorAuras(self,"Debuff",self.debuffs,rowcount);
  56.         rowcount,anchor2=ReanchorAuras(self,"Buff",self.buffs,rowcount);
  57.     end
  58.  
  59.     self.auraRows=rowcount;
  60.     self.spellbarAnchor=anchor1 or anchor2;
  61. end);


All times are GMT -6. The time now is 04:13 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI