Quantcast

Updated for newest oUF tags

Cynyr [07-02-10 - 17:25]
Updated for newest oUF tags
Filename
oUF_PowerBar.lua
tags.lua
diff --git a/oUF_PowerBar.lua b/oUF_PowerBar.lua
index 517f2cc..bcd2e12 100755
--- a/oUF_PowerBar.lua
+++ b/oUF_PowerBar.lua
@@ -84,7 +84,7 @@ local function style(self, unit)
 	    local power = self.Power:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallLeft')
 	    power:SetPoint('CENTER', self.Power, 'CENTER')
 	    power.frequentUpdates = 0.1
-	    self:Tag(power, '[ppower][( )druidpower]')
+	    self:Tag(power, '[ppower][druidpower]')

         --Use oUF_BarFader to fade the bar.
         if(unit=="player" and IsAddOnLoaded("oUF_BarFader")) then
diff --git a/tags.lua b/tags.lua
index 91321fd..13057d8 100755
--- a/tags.lua
+++ b/tags.lua
@@ -29,17 +29,17 @@ local function hex(r, g, b)
 	return ('|cff%02x%02x%02x'):format(r * 255, g * 255, b * 255)
 end

-oUF.Tags['[pvptime]'] = function(unit)
+oUF.Tags['pvptime'] = function(unit)
 	return UnitIsPVP(unit) and not IsPVPTimerRunning() and '*' or IsPVPTimerRunning() and ('%d:%02d'):format((GetPVPTimer() / 1000) / 60, (GetPVPTimer() / 1000) % 60)
 end

-oUF.TagEvents['[pthreat]'] = 'UNIT_THREAT_LIST_UPDATE'
-oUF.Tags['[pthreat]'] = function()
+oUF.TagEvents['pthreat'] = 'UNIT_THREAT_LIST_UPDATE'
+oUF.Tags['threat'] = function()
 	local _, _, perc = UnitDetailedThreatSituation('player', 'target')
 	return perc and ('%s%d%%|r'):format(hex(GetThreatStatusColor(UnitThreatSituation('player', 'target'))), perc)
 end

-oUF.Tags['[phealth]'] = function(unit)
+oUF.Tags['phealth'] = function(unit)
 	local min, max = UnitHealth(unit), UnitHealthMax(unit)

 	local status = not UnitIsConnected(unit) and 'Offline' or UnitIsGhost(unit) and 'Ghost' or UnitIsDead(unit) and 'Dead'
@@ -49,13 +49,13 @@ oUF.Tags['[phealth]'] = function(unit)
 	return status and status or target and target or player and player or min ~= max and ('%s |cff0090ff/|r %s'):format(shortVal(min), shortVal(max)) or max
 end

-oUF.Tags['[ppower]'] = function(unit)
+oUF.Tags['ppower'] = function(unit)
 	local _, str = UnitPowerType(unit)
-	return ('%s%d|r'):format(hex(colors.power[str] or {1, 1, 1}), oUF.Tags['[curpp]'](unit) or '')
+	return ('%s%d|r'):format(hex(colors.power[str] or {1, 1, 1}), oUF.Tags['curpp'](unit) or '')
 end

-oUF.TagEvents['[pname]'] = 'UNIT_NAME_UPDATE UNIT_REACTION UNIT_FACTION'
-oUF.Tags['[pname]'] = function(unit)
+oUF.TagEvents['pname'] = 'UNIT_NAME_UPDATE UNIT_REACTION UNIT_FACTION'
+oUF.Tags['pname'] = function(unit)
 	local colorString = hex((UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) and colors.tapped or
 		(not UnitIsConnected(unit)) and colors.disconnected or
 		(not UnitIsPlayer(unit)) and colors.reaction[UnitReaction(unit, 'player')] or
@@ -64,8 +64,8 @@ oUF.Tags['[pname]'] = function(unit)
 	return ('%s%s|r'):format(colorString, UnitName(unit))
 end

-oUF.TagEvents['[druidpower]'] = 'UNIT_MANA UPDATE_SHAPESHIFT_FORM'
-oUF.Tags['[druidpower]'] = function(unit)
+oUF.TagEvents['druidpower'] = 'UNIT_MANA UPDATE_SHAPESHIFT_FORM'
+oUF.Tags['druidpower'] = function(unit)
 	local min, max = UnitPower(unit, 0), UnitPowerMax(unit, 0)
 	return unit == 'player' and UnitPowerType(unit) ~= 0 and min ~= max and ('|cff0090ff%d%%|r'):format(min / max * 100)
 end