View Single Post
10-14-08, 09:13 AM   #94
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Disbanding oUF_DruidMana

oUF_DruidMana is no more, its easier for me and you to add this to the layout instead.

Here is an example (like the original)
Code:
local function PreUpdatePower(self, event, unit)
	ifi(self.unit ~= 'player') then return end

	local _, powertype = UnitPowerType('player')
	local min = UnitPower('player', SPELL_POWER_MANA)
	local max = UnitPowerMax('player', SPELL_POWER_MANA)

	self.DruidMana:SetMinMaxValues(0, max)
	self.DruidMana:SetValue(min)

	if(min ~= max) then
		self.DruidMana.Text:SetFormattedText('%d%%', math.floor(min / max * 100))
	else
		self.DruidMana.Text:SetText()
	end

	self.DruidMana:SetAlpha((powertype ~= 0) and 1 or 0)
	self.DruidMana.Text:SetAlpha((powertype ~= 0) and 1 or 0)
end
You can use either Pre- or PostUpdatePower