Thread Tools Display Modes
01-10-12, 07:53 AM   #1
Irongunner
A Deviate Faerie Dragon
Join Date: Mar 2011
Posts: 11
Layouts depending on raid size (10/25/40)

Hey guys,

I am trying to create different (grid-style) layouts for 10, 25 and 40 player raid size. The way I am spawning my raid frames is this:

Code:
  local initconfig = [[
    self:SetWidth(%d)
    self:SetHeight(%d)
  ]]

  local raid = {}
    
  for i = 1, NUM_RAID_GROUPS do
    raid[i] = oUF:SpawnHeader("oUF_Raid"..i, "SecureRaidGroupHeaderTemplate", "custom [@raid6,exists,group:raid] show;hide",
                                         "showPlayer", true,
                                         "oUF-initialConfigFunction", (initconfig):format(32, 22),
                                         "sortMethod", "NAME",
                                         "groupFilter", i,
                                         "yOffset", 49 -- grow up
                                        )
    raid[i]:SetPoint("TOPLEFT", UIParent, "CENTER", 391 + 37*(i-1), -451)
  end
Can you tell me how to create different layouts depending on raid size?
It would also be useful to have some kind of function hook to reposition other UI-elements (dmg meter etc.) depending on the detected raid size.

I also need some whitelist-based buff/debuff icons on my raid frames and the possibility to display more than one buff/debuff per unit on these raidframes (for example for hagara hc decursing when unit is inside the blue bubble). Any suggestions how to achieve this?
  Reply With Quote
01-12-12, 05:02 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
You can check oUF_Simple2 or oUF_Diablo. Both use it.

This are the visibility attributes of oUF_Diablo:
http://code.google.com/p/rothui/sour...config.lua#534

This is how they are set up:
http://code.google.com/p/rothui/sour...s/raid.lua#438

Hope that helps.

Basically I'm only changing the scale of the frames based on gives raid size.

But there are 3 completly different spawns and you could adjust each of one to be completly different.

The visibility attributes tell the header when to show/hide each layout.
__________________
| 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 : 01-12-12 at 05:05 AM.
  Reply With Quote
01-12-12, 07:08 AM   #3
Irongunner
A Deviate Faerie Dragon
Join Date: Mar 2011
Posts: 11
Ty Zork, works fine. I still need a way to hook a function which is called if raid size falls under 10 or increases over 25 players, so i can adjust some other UI elements too.

What about the second part of my question, adding multiple buffs/debuffs per player in the raid frames depending on a whitelist configuration? oUF RaidDebuffs plugin can't do this.

Last edited by Irongunner : 01-12-12 at 07:49 AM.
  Reply With Quote
01-12-12, 08:09 AM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
You want to create a helper frame with a function that tracks the "PARTY_MEMBERS_CHANGED" event. http://www.wowwiki.com/Events/P

lua Code:
  1. local helpRaidFunc = function(self, event, ...)
  2.     if not event or event ~= "PARTY_MEMBERS_CHANGED" then return end
  3.     local raid = GetNumRaidMembers() or 0
  4.     local party = GetNumPartyMembers() or 0
  5.     if raid > 0 then
  6.       --do raid adjustments
  7.     elseif party > 0 then
  8.       --do party adjustments
  9.     end
  10.   end
  11.  
  12.   local helpRaid = CreateFrame("Frame")
  13.   helpRaid:RegisterEvent("PARTY_MEMBERS_CHANGED")
  14.   helpRaid:SetScript("OnEvent", helpRaidFunc)

If you need to adjust stuff that is protected in combat you can check for InCombatLockdown() and register the PLAYER_REGEN_ENABLED event and adjust stuff once you get OOC.

I'm using black/whitelisting for raid debuffs myself. You may want to check my aura script:
http://code.google.com/p/rothui/sour...ts/raid.lua#37
Using the customFilter of oUF aura function you can create a filter yourself.
My black/whitelist example: http://code.google.com/p/rothui/sour...config.lua#507
__________________
| 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 : 01-12-12 at 08:14 AM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Layouts depending on raid size (10/25/40)


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