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,740
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)

"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,740
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)

"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,740
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)

"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-30-10, 04:19 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
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)

"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

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


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