Thread Tools Display Modes
02-22-12, 12:31 PM   #21
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Oh the splitting of the group in different raid headers per group is nice.

@Game92
It's no wonder that it has not worked. You choosed a global unique name for your header which is the same for every group spawn. Normally you put in the group id into the string to make it unique. Using nil will make oUF choose a string.

Like:
Code:
"Aftermathh_Raid25Group"..group
I added it to my layout aswell.

config attributes
Code:
      attributes = {
        visibility1         = "custom [@raid11,exists] hide;[group:raid] show; hide", --use "party,raid" to show this in party aswell
        visibility2         = "custom [@raid26,exists] hide; [@raid11,exists] show; hide", --special display for raid > 20 players (lower scale)
        visibility3         = "custom [@raid26,exists] show; hide", --special display for raid > 30 players (lower scale)
        showPlayer          = false,  --make this true to show player in party
        showSolo            = false,  --make this true to show while solo (only works if solo is in visiblity aswell
        showParty           = false,  --make this true to show raid in party
        showRaid            = true,   --show in raid
        point               = "TOP",
        yOffset             = 15,
        xoffset             = 0,
        maxColumns          = 8,
        unitsPerColumn      = 5,
        columnSpacing       = -20,
        columnAnchorPoint   = "LEFT",
      },
spawn
lua Code:
  1. if cfg.units.raid.show then
  2.  
  3.     --register style
  4.     oUF:RegisterStyle("diablo:raid", createStyle)
  5.     oUF:SetActiveStyle("diablo:raid")
  6.  
  7.     local attr = cfg.units.raid.attributes
  8.  
  9.     local function getRaidScale(id)
  10.       if id == 1 then
  11.         return cfg.units.raid.scale
  12.       elseif id == 2 then
  13.         return cfg.units.raid.scale*0.9
  14.       else
  15.         return cfg.units.raid.scale*0.75
  16.       end
  17.     end
  18.  
  19.     local function getRaidVisibility(id)
  20.       if id == 1 then
  21.         return attr.visibility1
  22.       elseif id == 2 then
  23.         return attr.visibility2
  24.       else
  25.         return attr.visibility3
  26.       end
  27.     end
  28.  
  29.     local raid, group, i, j
  30.  
  31.     for i=1, 3 do
  32.       raid = {}
  33.       for j=1, NUM_RAID_GROUPS do
  34.         group = oUF:SpawnHeader(
  35.           "oUF_DiabloRaid"..i.."Group"..j, --name of raid group header
  36.           nil,
  37.           getRaidVisibility(i),
  38.           "showPlayer",         attr.showPlayer,
  39.           "showSolo",           attr.showSolo,
  40.           "showParty",          attr.showParty,
  41.           "showRaid",           attr.showRaid,
  42.           "point",              attr.point,
  43.           "yOffset",            attr.yOffset,
  44.           "xoffset",            attr.xoffset,
  45.           --"groupFilter",        "1,2,3,4,5,6,7,8",
  46.           "groupFilter",        tostring(j),
  47.           "groupBy",            "GROUP",
  48.           "groupingOrder",      "1,2,3,4,5,6,7,8",
  49.           "sortMethod",         "NAME",
  50.           --"maxColumns",         attr.maxColumns,
  51.           "unitsPerColumn",     attr.unitsPerColumn,
  52.           --"columnSpacing",      attr.columnSpacing,
  53.           --"columnAnchorPoint",  attr.columnAnchorPoint,
  54.           "oUF-initialConfigFunction", ([[
  55.             self:SetWidth(%d)
  56.             self:SetHeight(%d)
  57.           ]]):format(128, 64)
  58.         )
  59.         group:SetScale(getRaidScale(i))
  60.         if j == 1 then
  61.           group:SetPoint(cfg.units.raid.pos.a1,cfg.units.raid.pos.af,cfg.units.raid.pos.a2,cfg.units.raid.pos.x,cfg.units.raid.pos.y)
  62.         else
  63.           if attr.columnAnchorPoint == "TOP" then
  64.             group:SetPoint("TOPLEFT", raid[j-1], "BOTTOMLEFT", 0, attr.columnSpacing)
  65.           elseif attr.columnAnchorPoint == "BOTTOM" then
  66.             group:SetPoint("BOTTOMLEFT", raid[j-1], "TOPLEFT", 0, attr.columnSpacing)
  67.           elseif attr.columnAnchorPoint == "LEFT" then
  68.             group:SetPoint("TOPLEFT", raid[j-1], "TOPRIGHT", attr.columnSpacing, 0)
  69.           else
  70.             group:SetPoint("TOPRIGHT", raid[j-1], "TOPLEFT", attr.columnSpacing, 0)
  71.           end
  72.         end
  73.         raid[j] = group
  74.       end
  75.     end
  76.   end

I spawn 3 different raid layouts in 3 different sizes.



Currently testing.

Had some scaling issues but after removing the scale from the UnitButton and adding it to the group it worked like charm.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

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

Last edited by zork : 02-22-12 at 02:34 PM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Grouping / Sorting Question


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