Thread Tools Display Modes
07-01-10, 07:42 PM   #1
tukz
A Fallenroot Satyr
 
tukz's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 20
Help for oUF_Raid units. (1.4)

I'm currently re-writing my raidframe to something new and i'm unable to do one thing. I need a little bit of help. It is possible to... with oUF 1.4... I think i'm gonna explain it first.

I want 4 layouts based on how many people are currently in raid, into a single file, with 1 style. This is my code at the bottom at the moment:

Code:
local raid = oUF:SpawnHeader('TukuiRaid', nil, 'raid,party','showPlayer', true,'showParty', true,'showRaid', true,
	'xoffset', 4,'yOffset', -4,'point', "LEFT",'groupFilter', '1,2,3,4,5,6,7,8','groupingOrder', '1,2,3,4,5,6,7,8','groupBy', 'GROUP',
	'maxColumns', 40,'unitsPerColumn', 1,'columnSpacing', 5,'columnAnchorPoint', "TOP"
)
raid:SetPoint('TOPLEFT', UIParent, 15, -300)
I want to rescale and reposition all units based on how many peoples (with a local Var) are currently in the raid based on these events:

Code:
PLAYER_LOGIN
RAID_ROSTER_UPDATE
PARTY_LEADER_CHANGED
PARTY_MEMBERS_CHANGED
Repositionning is easy, we just need to reposition the header with SetPoint(). It's easy too if we rescale the header, but it's not really what i want, because I need to rescale all units from the start instead of the header to have a 1px pixel perfect border on any scale and any units. Example, actually i'm in raid10, if a unit 11 enter the raid, I want units 1 to 11 rescaled and repositionned from the start.

Does there is a way to tell the layout to rescale all units from unit #1 when numraid or numparty (see below example) change?

Code:
TukuiDB.RaidScale = function(self, event, unit)
	local numraid = GetNumRaidMembers()
	local numparty = GetNumPartyMembers()
	if (numparty <= 5) or (numraid <= 5) then
		TukuiDB.RaidScaling = 1.2
	elseif numraid > 5 and numraid <=10 then
		TukuiDB.RaidScaling = 1
(...)
end
Thank you.

Hope you'll understand, english is not my native language.
  Reply With Quote
07-01-10, 11:53 PM   #2
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
From Haste in the documentation post :

Originally Posted by haste View Post
oUF:SpawnHeader(overrideName, template, visibility, ...)
- overrideName: just a custom frame name. Leaving it as nil/false will make oUF generate one based on style (and "unit"). Like: oUF_LilyParty.
- template: What template to base the header on. Leaving it as nil/false will make oUF use SecureGroupHeaderTemplate.
- visibility: A comma separated string that controls the headers visibility. By default oUF defines the following states:
Code:
raid40: Show when in a raid with 26 or more, but not party.
raid25: Show when in a raid with 11 or more, but not party.
raid10: Show when in a raid with 6 or more, but not party.
raid: Show when in a raid, but not party.
party: Show when in a party, but not raid.
solo: Show when not in a group.
- ...: Just a list of attributes you want to set on the header. It's what replaces :SetManyAttributes().

You can also create custom visibility rules with:
Code:
custom [combat] show;hide
Using oUF_Lily's :SpawnHeader() as an example:
Lua Code:
  1. local party = self:SpawnHeader(nil, nil, 'raid,party,solo', 'showParty', true, 'showPlayer', true, 'yOffset', -20)
  2. party:SetPoint("TOPLEFT", 30, -30)
This spawns a party frame named oUF_<Style>Party, which is shown when you are in a raid, party or solo. It also sets the attributes showParty and showPlayer as they are required to populate the header with units.

The main reason that it has solo in the visibility list is really because I tend to do showSolo, true when I want to test some minor things. It can safely be removed.

Hope this helps slightly at least :P.
You could spawn your raid groups with the state raid10, raid25 etc
  Reply With Quote
07-02-10, 02:22 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
He said try sth like this

Code:
    local raid40 = {}
    for i = 1, NUM_RAID_GROUPS do
      raid40[i] = oUF:SpawnHeader("oUF_Raid"..i, nil, "raid40",  "groupFilter", i, "showRaid", true, "yOffSet", -20)
      if i == 1 then
        raid40[i]:SetPoint("TOPLEFT", 10, -20)
      else
        raid40[i]:SetPoint("TOPLEFT", raid[i-1], "TOPRIGHT", -15, 0)
      end
    end
Code:
    local raid25 = {}
    for i = 1, NUM_RAID_GROUPS do
      raid25[i] = oUF:SpawnHeader("oUF_Raid"..i, nil, "raid25",  "groupFilter", i, "showRaid", true, "yOffSet", -20)
      if i == 1 then
        raid25[i]:SetPoint("TOPLEFT", 10, -20)
      else
        raid25[i]:SetPoint("TOPLEFT", raid[i-1], "TOPRIGHT", -15, 0)
      end
    end
Code:
    local raid10 = {}
    for i = 1, NUM_RAID_GROUPS do
      raid10[i] = oUF:SpawnHeader("oUF_Raid"..i, nil, "raid10",  "groupFilter", i, "showRaid", true, "yOffSet", -20)
      if i == 1 then
        raid10[i]:SetPoint("TOPLEFT", 10, -20)
      else
        raid10[i]:SetPoint("TOPLEFT", raid[i-1], "TOPRIGHT", -15, 0)
      end
    end
You can even activate different StyleFunctions for each spawn.

Not sure how to handle raid that is between 1 and 5 players without interfering the other spawns.
__________________
| 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
07-02-10, 09:44 AM   #4
tukz
A Fallenroot Satyr
 
tukz's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 20
thank's for your help, i found a way to do it.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Help for oUF_Raid units. (1.4)


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