Quantcast

Simplyfy the druid power "element"

Adrian L Lange [08-13-09 - 16:41]
Simplyfy the druid power "element"
Filename
customtags.lua
oUF_P3lim.lua
diff --git a/customtags.lua b/customtags.lua
index 688c1b9..39d7aa8 100644
--- a/customtags.lua
+++ b/customtags.lua
@@ -66,6 +66,5 @@ end

 oUF.TagEvents['[druidpower]'] = 'UNIT_MANA UPDATE_SHAPESHIFT_FORM'
 oUF.Tags['[druidpower]'] = function(unit)
-	local value = UnitPower(unit, 0)
-	return UnitPowerType(unit) ~= 0 and ('|cff0090ff%d - %d%%|r'):format(value, value / UnitPowerMax(unit, 0) * 100)
+	return UnitPowerType(unit) ~= 0 and ('|cff0090ff%d%%|r'):format(UnitPower(unit, 0) / UnitPowerMax(unit, 0) * 100)
 end
diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua
index 4855e0e..b7255c5 100644
--- a/oUF_P3lim.lua
+++ b/oUF_P3lim.lua
@@ -247,7 +247,7 @@ local function styleFunction(self, unit)
 		local power = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallLeft')
 		power:SetPoint('LEFT', self.Health, 2, -1)
 		power.frequentUpdates = 0.1
-		self:Tag(power, '[ppower]')
+		self:Tag(power, unit == 'player' and '[ppower][( )druidpower]' or '[ppower]')

 		self.BarFade = true
 	else
@@ -311,24 +311,6 @@ local function styleFunction(self, unit)
 		self.PostUpdateAuraIcon = updateDebuff
 	end

-	if(unit == 'player' and class == 'DRUID') then
-		self.DruidPower = CreateFrame('StatusBar', self:GetName()..'_druidpower', self)
-		self.DruidPower:SetPoint('TOP', self.Health, 'BOTTOM')
-		self.DruidPower:SetStatusBarTexture(texture)
-		self.DruidPower:SetHeight(1)
-		self.DruidPower:SetWidth(230)
-		self.DruidPower:SetAlpha(0)
-
-		local value = self.DruidPower:CreateFontString(nil, 'OVERLAY', 'GameFontNormalSmall')
-		value:SetPoint('CENTER', self.DruidPower)
-		self:Tag(value, '[druidpower]')
-
-		table.insert(self.__elements, updateDruidPower)
-		self:RegisterEvent('UNIT_MANA', updateDruidPower)
-		self:RegisterEvent('UNIT_ENERGY', updateDruidPower)
-		self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', updateDruidPower)
-	end
-
 	if(IsAddOnLoaded'oUF_Reputation' and unit == 'player' and UnitLevel('player') == MAX_PLAYER_LEVEL) then
 		self.Reputation = CreateFrame('StatusBar', self:GetName()..'_reputation', self)
 		self.Reputation:SetPoint('TOP', self, 'BOTTOM', 0, -10)