Quantcast oUF 1.4 documentation thread - WoWInterface
Thread Tools Display Modes
06-28-10, 07:21 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
oUF 1.4 documentation thread

Maybe we can gather some kind of documentation thread for all the oUF 1.4 features.

Current wiki:
http://wiki.github.com/haste/oUF/

oUF 1.4 the list
http://www.wowinterface.com/forums/s...ad.php?t=29937

Latest commit:
http://github.com/haste/oUF/commits/master
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

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

Last edited by zork : 06-28-10 at 07:26 AM.
  Reply With Quote
06-28-10, 07:22 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
What I'm looking for is a documentation on how to spawn units.

Especially those that can be tricky.

- party
- raid
- boss
- vehicle
- partypet
- raidpet
- arena
- arenatarget
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

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

Last edited by zork : 06-28-10 at 07:33 AM.
  Reply With Quote
06-28-10, 08:04 AM   #3
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Here's the wiki related todo items on my list:
- [3] Document changes between 1.3.x and 1.4.x
- [3] Write wiki page about pit falls
- [2] Write wiki page about the core
- [1] Write wiki page about auras
- [1] Write wiki page about how the event handler differ
- [1] Write wiki page about how hooks/callbacks work
- [1] Write wiki page about portraits
- [1] Write wiki page about rune bar
- [1] Write wiki page about tags
- [1] Write wiki page about the element system
- [1] Write wiki page about the range element

The number in front is the priority it has. I won't be able to do anything with any of these until August however =/.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
06-28-10, 08:20 AM   #4
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
I'm currently spawning maintank (and maintank target via xml template) and boss frames like this

Code:
	self:SetActiveStyle"Nivea - Boss"
	local boss = {}
		for i = 1, MAX_BOSS_FRAMES do
			local unit = self:Spawn("boss"..i, "oUF_NiveaBoss"..i)

			if i==1 then
				unit:SetPoint("CENTER", 400, 200)
			else
				unit:SetPoint("TOPLEFT", boss[i-1], "BOTTOMLEFT", 0, -10)
			end
			boss[i] = unit
		end
		
	self:SetActiveStyle"Nivea - MainTank"
	local Main_Tank = self:SpawnHeader("oUF_MainTank", nil, 'raid,party,solo', 
		'showRaid', true, 
		"groupFilter", "MAINTANK", 
		'yOffset', -20, 
		"template", "oUF_NiveaMTartemplate"
	)
	Main_Tank:SetPoint("TOP", UIParent, "TOP", 540, -280)

and I adress them via

Code:
local UnitSpecific = {
	boss = function(self)
		Shared(self)
		
		self.Power:SetWidth(Ncfgfs.width.M)			
		self:SetAttribute('initial-height', Ncfgfs.height.M)
		self:SetAttribute('initial-width', Ncfgfs.width.M)		
	end,
	
	MainTank = function(self)
		Shared(self)
		
		self.Power:SetWidth(Ncfgfs.width.M)			
		self:SetAttribute('initial-height', Ncfgfs.height.M)
		self:SetAttribute('initial-width', Ncfgfs.width.M)		
	end,	
		
}
I don't know if that's a good way, but it works. I'll have to look into arena frames, later.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
06-28-10, 02:57 PM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
Can anyone explain my the new SpawnHeader for party please. God...this doesn't work for me...

crap...I had to use a setpoint on party...
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

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

Last edited by zork : 06-28-10 at 03:05 PM.
  Reply With Quote
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
06-28-10, 03:22 PM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Oh, and don't be afraid to ask questions regarding 1.4.x stuff. My vacation starts in 36 hours, so I'll probably be quite AFK until the weekend. I'll try to answer as much as possible before that time.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
06-28-10, 09:30 PM   #8
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Is it possible to use raid10, raid25 and raid40 as UnitSpecific, directly? I mean just like player, pet, etc.

Something like this ...

Code:
local UnitSpecific = {
	raid10 = function(self)
		Shared(self)
					
		self:SetAttribute('initial-height', 26)
		self:SetAttribute('initial-width', 80)		
	end,
	
	raid25 = function(self)
		Shared(self)
				
		self:SetAttribute('initial-height', 20)
		self:SetAttribute('initial-width', 40)		
	end,	
		
}
That would be pretty damn awesome, because you could have different raidframes for different raid sizes, really easy.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
06-29-10, 01:44 AM   #9
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
oUF doesn't really know about the visibility states when it executes the style function, but it does feed it 'party' and 'raid' now, instead of nil.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
06-29-10, 08:38 AM   #10
aiikachi
A Cyclonian
 
aiikachi's Avatar
Join Date: Jan 2007
Posts: 44
In previous versions of oUF, my personal layout had a code to skin the mirrorbars to match my castbars...It seems that that same code is currently non-functional in 1.4. I am in no means an expert at lua, but if you could point me in the right direction to updating my code for 1.4, I'd appreciate it.
  Reply With Quote
06-29-10, 11:59 AM   #11
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
oUF does not care about mirrorbars.

Code:
for _, bar in pairs({'MirrorTimer1','MirrorTimer2','MirrorTimer3',}) do   
	for i, region in pairs({_G[bar]:GetRegions()}) do
		if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
			region:Hide()
		end
	end

	_G[bar..'Border']:Hide()

	_G[bar]:SetParent(UIParent)
	_G[bar]:SetPoint('TOP', UIParent, 'TOP', 0, -300)
	_G[bar]:SetScale(1)
	_G[bar]:SetHeight(16)
	_G[bar]:SetWidth(180)
	_G[bar]:SetBackdrop(backdrop)
	_G[bar]:SetBackdropColor(0,0,0)

	_G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
	_G[bar..'Background']:SetTexture(texture)
	_G[bar..'Background']:SetAllPoints(bar)
	_G[bar..'Background']:SetVertexColor(29/255,29/255,29/255,.75)

	_G[bar..'Text']:SetFont(font,9)
	_G[bar..'Text']:ClearAllPoints()
	_G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)

	_G[bar..'StatusBar']:SetAllPoints(_G[bar])
	_G[bar..'StatusBar']:SetStatusBarTexture(texture)
	_G[bar..'StatusBar']:GetStatusBarTexture():SetHorizTile(false)
end
Nothing in this is related to oUF (don't play anymore, so I don't know if this works).
  Reply With Quote
06-29-10, 03:51 PM   #12
aiikachi
A Cyclonian
 
aiikachi's Avatar
Join Date: Jan 2007
Posts: 44
Thanks for the quick reply Rostok. That code was very similar to what I had previously used, and with a little tweeking is now working for me just fine
  Reply With Quote
06-30-10, 04:19 AM   #13
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
My own oUF/elements/aura.lua documentation

Hopefully most of the stuff is correct

--[[

Elements handled: self.Auras, self.Buffs, self.Debuffs

Icon sub-objects:
- button.overlay: contains the border that will get displayed on on specific debuffs
- button.parent:containts the parent object the current button is attached to
- button.icon: the texture of the aura icon that is displayed on the button
- button.count: some buttons have a stack (count) this is the fontstring that contains the stack
- button.cd: the cooldown spiral

Other sub-objects:
- icon.isPlayer: is the caster of the icon the player
- icon.owner: owner of the icon
- icon.filter: filter for icon display
- icon.debuff: defines if the icon is a debuff
- auras.visibleBuffs: number of visible buffs displayed
- auras.visibleDebuffs: number of visible debuffs displayed
- auras.visibleAuras: number of visible auras displayed

self.Auras, self.Buffs, self.Debuffs (shared):
- .spacing: Padding between aura icons. (Default: 0)
- .size: Size of the aura icons. (Default: 16)
- .initialAnchor: Initial anchor in the aura frame. (Default: "BOTTOMLEFT")
- .onlyShowPlayer: Only display icons casted by the player. (Default: nil)
- ["growth-x"]: Growth direction, affected by initialAnchor. (Default: "UP")
- ["growth-y"]: Growth direction, affected by initialAnchor. (Default: "RIGHT")
- .disableCooldown: Disable the Cooldown Spiral on the Aura Icons. (Default: nil)
- .filter: Expects a string with filter. See the UnitAura[1] documentation for more information.
[1] http://www.wowwiki.com/API_UnitAura

.Auras only:
- .gap: Adds a empty icon to separate buffs and debuffs. (Default: nil)
- .numBuffs: The maximum number of buffs that should be shown. (Default: 32)
- .numDebuffs: The maximum number of debuffs that should be shown. (Default: 40)
- .buffFilter: See filter on Shared. (Default: "HELPFUL")
- .debuffFilter: See filter on Shared. (Default: "HARMFUL")
- Variables set by .Auras:
- .visibleBuffs: Number of currently visible buff icons.
- .visibleDebuffs: Number of currently visible debuff icons.
- .visibleAuras: Total number of currently visible buffs + debuffs.

.Buffs only:
- .num: The maximum number of buffs that should be shown. (Default: 32)
- Variables set by .Buffs:
- .visibleBuffs: Number of currently visible buff icons.

.Debuffs only:
- .num: The maximum number of debuffs that should be shown. (Default: 40)
- Variables set by .Debuffs:
- .visibleDebuffs: Number of currently visible debuff icons.

Functions that can be overridden from within a layout:
- PostCreateIcon(self, button)
- PostUpdateIcon(self, unit, icon, index, offset)
- PostUpdate(self, unit)
- PreUpdate(self, unit)
- PreSetPosition(self, num)

Examples on how to attach functions to your layout:

--------------------------------------------------
-- POSTCREATEICON FUNCTION
-- lets you style aura icons after they got created
--------------------------------------------------


local function myPostCreateIcon(self, button)
--do stuff
end

--possible calls
self.Auras.PostCreateIcon = myPostCreateIcon
self.Buffs.PostCreateIcon = myPostCreateIcon
self.Debuffs.PostCreateIcon = myPostCreateIcon

--------------------------------------------------
-- POSTUPDATEICON FUNCTION
-- lets you do stuff to aura icons once they got updated
--------------------------------------------------


local function myPostUpdateIcon(self, unit, icon, index, offset)
--do stuff
end

--possible calls
self.Auras.PostUpdateIcon = myPostUpdateIcon
self.Buffs.PostUpdateIcon = myPostUpdateIcon
self.Debuffs.PostUpdateIcon = myPostUpdateIcon

--------------------------------------------------
-- POSTUPDATE FUNCTION
-- lets you do stuff to auras after they get updated
--------------------------------------------------


local function myPostUpdate(self, unit)
--do stuff
end

--possible calls
self.Auras.PostUpdate = myPostUpdate
self.Buffs.PostUpdate = myPostUpdate
self.Debuffs.PostUpdate = myPostUpdate

--------------------------------------------------
-- PREUPDATE FUNCTION
-- lets you do stuff to auras before they get updated
--------------------------------------------------


local function myPreUpdate(self, unit)
--do stuff
end

--possible calls
self.Auras.PreUpdate = myPreUpdate
self.Buffs.PreUpdate = myPreUpdate
self.Debuffs.PreUpdate = myPreUpdate

--------------------------------------------------
-- PRESETPOSITION FUNCTION
-- lets you do stuff to auras before they get arranged in position
--------------------------------------------------


local function myPreSetPosition(self, num)
--do stuff
end

--possible calls
self.Auras.PreSetPosition = myPreSetPosition
self.Buffs.PreSetPosition = myPreSetPosition
self.Debuffs.PreSetPosition = myPreSetPosition

]]--
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

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

Last edited by zork : 06-30-10 at 07:02 AM.
  Reply With Quote
07-01-10, 01:44 AM   #14
Luzzifus
A Warpwood Thunder Caller
 
Luzzifus's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 94
Originally Posted by haste View Post
oUF:SpawnHeader(overrideName, template, visibility, ...)
- template: What template to base the header on. Leaving it as nil/false will make oUF use SecureGroupHeaderTemplate.
How do I use those templates? Are they like tags but for frame style or is it something else?
  Reply With Quote
07-01-10, 02:56 AM   #15
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Code:
local party = self:SpawnHeader(nil, nil, 'raid,party,solo', 'showParty', true, 'showPlayer', true, 'yOffset', -20)
in the oUF_Lily code.
  Reply With Quote
07-01-10, 06:42 PM   #16
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Question: How to adress party pets and raid pets?

I'm using

Code:
local UnitSpecific = {
	player = function(self)

	party = function(self)
etc.

end
Is there something like "partypet"? I know party pet doesn't work, but...

I spawn party pets via XML, they are there, but they inherit everything from party (oh wonder...).

How can I change the appearance of party and raid pets? How to adress them if I build my layout like that?
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
07-02-10, 08:47 AM   #17
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Luzzifus View Post
How do I use those templates? Are they like tags but for frame style or is it something else?
They're XML templates. oUF just feeds them directly to CreateFrame/:SetAttribute.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
07-03-10, 09:43 AM   #18
LCFHeLL
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 4
is it buff or?

can't understand, how can i find is it buff or debuff in a PostCreateIcon function...
now I use different functions for creating icons for buffs and debuffs, perhaps you can do as it otherwise?

Last edited by LCFHeLL : 07-03-10 at 09:58 AM.
  Reply With Quote
07-03-10, 10:28 AM   #19
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
Originally Posted by LCFHeLL View Post
can't understand, how can i find is it buff or debuff in a PostCreateIcon function...
now I use different functions for creating icons for buffs and debuffs, perhaps you can do as it otherwise?
Have you tried using PostUpdateIcon instead?
  Reply With Quote
07-03-10, 10:36 AM   #20
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
Just check for button.debuff ! This one is filled if the aura is a debuff.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

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

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF 1.4 documentation thread

Thread Tools
Display Modes

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