From 50e0587a125f4a5ff1aa0755b7076465d46aa7c0 Mon Sep 17 00:00:00 2001 From: Cynyr Date: Fri, 2 Jul 2010 12:25:55 -0500 Subject: [PATCH] Updated for newest oUF tags --- oUF_PowerBar.lua | 2 +- tags.lua | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) 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 -- 1.7.9.5