Thread Tools Display Modes
02-23-11, 11:14 AM   #1
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Two column party

I'm stuck on this one... Is there a way to spawn a party-header, which creates a 2x2 party-layout?

Currently my code is like this (early dev):

lua Code:
  1. local party
  2.     oUF:RegisterStyle('oUF_PhantomMenace_party', PhantomMenace_party)
  3.     oUF:SetActiveStyle('oUF_PhantomMenace_party')
  4.     party = oUF:SpawnHeader('oUF_PhantomMenace_party',
  5.                                     nil,
  6.                                     'solo,party',
  7.                                     'showSolo', false,
  8.                                     'showRaid', true,
  9.                                     'showParty', true,
  10.                                     'showPlayer', false,
  11.                                     'xOffset', 20,
  12.                                     'yOffset', 20,
  13.                                     'sortMethod', 'NAME',
  14.                                     'maxColumns', 2,
  15.                                     'unitsPerRow', 2,
  16.                                     'point', 'LEFT',
  17.                                     'columnAnchorPoint', 'BOTTOM'
  18.                                     )
  19.     party:SetPoint('LEFT', UIParent, 'LEFT', 25, 0)
  20.     local party3, party4
  21.     party3 = _G['oUF_PhantomMenace_partyUnitButton3'] or nil
  22.     party4 = _G['oUF_PhantomMenace_partyUnitButton4'] or nil
  23.     if ( party3 ) then
  24.         party3:SetPoint('TOPLEFT', 'oUF_PhantomMenace_partyUnitButton1', 'BOTTOMLEFT', 0, -30)
  25.     end
  26.     if ( party4 ) then
  27.         party4:SetPoint('TOPLEFT', 'oUF_PhantomMenace_partyUnitButton2', 'BOTTOMLEFT', 0, -30)
  28.     end

It works. Obviously I have to \rl to apply the SetPoints, this can be achieved by one of our "beloved" party-toggle"-functions in the final layout. But I feel like missing a point to create this effect just by setting the right header-options.

Any hint, pls?
__________________
  Reply With Quote
02-23-11, 11:59 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
List of various configuration attributes. unitsPerRow doesn't exist, it should be unitsPerColumn.

You are also missing the oUF-initialConfigFunction attribute. Which means your frames will break when created while in combat (use the third argument to your style function to determine if you should set width yourself or not).

You can remove the crap you have below the spawn function. oUF Classic uses the following to do:
[party1] [party2]
[party3] [party4]

Lua Code:
  1. self:SetActiveStyle'Classic - Party'
  2.     local party = self:SpawnHeader(nil, nil, 'raid,party',
  3.         'showParty', true,
  4.         'yOffset', -40,
  5.         'xOffset', -40,
  6.         'maxColumns', 2,
  7.         'unitsPerColumn', 2,
  8.         'columnAnchorPoint', 'LEFT',
  9.         'columnSpacing', 15,
  10.      
  11.         'oUF-initialConfigFunction', [[
  12.             self:SetWidth(260)
  13.             self:SetHeight(48)
  14.         ]]
  15.     )
  16.     party:SetPoint("TOPLEFT", 30, -30)
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Two column party


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