Thread Tools Display Modes
Prev Previous Post   Next Post Next
08-18-10, 10:35 AM   #19
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
The standard cpoints element does not support pre and post update routines.

You would need to override the standard update routine to add them in.

Code:
local comboUpdate = function(self, event, unit)
	-- copied from standard update routine
	if(unit == 'pet') then return end

	local cp
	if(UnitExists'vehicle') then
		cp = GetComboPoints('vehicle', 'target')
	else
		cp = GetComboPoints('player', 'target')
	end

	local cpoints = self.CPoints
	for i=1, MAX_COMBO_POINTS do
		if(i <= cp) then
			cpoints[i]:Show()
		else
			cpoints[i]:Hide()
		end
	end

	-- add postupdate support
	if cpoints.PostUpdate then cpoints.PostUpdate(self) end
end

local comboPostUpdate = function(self)
	-- add code to check if combo elements are shown and move aura buttons
end

local style = function(self, unit)
	-- define your combo points element
	local cpoints = ...
	...

	cpoints.Update = comboUpdate
	cpoints.PostUpdate = comboPostUpdate

	self.CPoints = cpoints
end
disclaimer: this is all dry coded and guaranteed to contain bugs
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Runebar and combobar


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