View Single Post
06-28-10, 03:18 PM   #6
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
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.
__________________
「貴方は1人じゃないよ」
  Reply With Quote