View Single Post
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,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