From 48c06ad8a17b8898ac8599f0f66b4f328d23ff2a Mon Sep 17 00:00:00 2001 From: p3lim-52096 Date: Wed, 11 Mar 2009 16:46:18 +0000 Subject: [PATCH] Fixed color tags git-svn-id: svn://svn.wowinterface.com/oUF_P3lim-52/trunk@65 8c7459ed-49dc-4bc8-85d7-b6381a8f5413 --- oUF_P3lim/oUF_P3lim.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/oUF_P3lim/oUF_P3lim.lua b/oUF_P3lim/oUF_P3lim.lua index a7b41e5..4591768 100644 --- a/oUF_P3lim/oUF_P3lim.lua +++ b/oUF_P3lim/oUF_P3lim.lua @@ -24,6 +24,7 @@ local colors = setmetatable({ [4] = {1, 1, 0}, [5] = {0, 1, 0} }, {__index = oUF.colors.reaction}), + white = {1, 1, 1}, }, {__index = oUF.colors}) local function menu(self) @@ -46,19 +47,15 @@ end oUF.Tags['[colorpp]'] = function(unit) local num, str = UnitPowerType(unit) local c = colors.power[str] - return string_format('|cff%02x%02x%02x', c[1] * 255, c[2] * 255, c[3] * 255) + return c and string_format('|cff%02x%02x%02x', c[1] * 255, c[2] * 255, c[3] * 255) end oUF.Tags['[colorinfo]'] = function(unit) local c = (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')] - - if(c) then - return string_format('|cff%02x%02x%02x', c[1] * 255, c[2] * 255, c[3] * 255) - else - return '|cffffffff' - end + (not UnitIsPlayer(unit)) and colors.reaction[UnitReaction(unit, 'player')] or colors.white + + return c and string_format('|cff%02x%02x%02x', c[1] * 255, c[2] * 255, c[3] * 255) end oUF.TagEvents['[colorinfo]'] = 'UNIT_REACTION' -- 1.7.9.5