From 0767c380ddf1cf2c1bd4b4d1bd9b8f52ca30f059 Mon Sep 17 00:00:00 2001 From: yaroot Date: Wed, 20 Oct 2010 09:52:26 +0800 Subject: [PATCH] attemp to fix bn friends coloring --- core.lua | 6 +++--- friends.lua | 17 +++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) mode change 100644 => 100755 core.lua mode change 100644 => 100755 friends.lua diff --git a/core.lua b/core.lua old mode 100644 new mode 100755 index 142ff83..8a00b87 --- a/core.lua +++ b/core.lua @@ -69,11 +69,11 @@ ns.guildRankColor[0] = '|cffffffff' ns.diffColor = setmetatable({}, { __index = function(t,i) local c = i and GetQuestDifficultyColor(i) - if not c then return '|cffffffff' end - t[i] = Hex(c) - return t[i] + t[i] = c and Hex(c) or t[0] + return t[i] end }) +ns.diffColor[0] = '|cffffffff' ns.classColor = setmetatable({}, { __index = function(t,i) diff --git a/friends.lua b/friends.lua old mode 100644 new mode 100755 index a8fcd49..f84d821 --- a/friends.lua +++ b/friends.lua @@ -12,7 +12,7 @@ local function friendsFrame() local playerArea = GetRealZoneText() for i = 1, #buttons do - local nameText, nameColor, infoText + local nameText, infoText button = buttons[i] index = offset + i if(button:IsShown()) then @@ -28,12 +28,12 @@ local function friendsFrame() local presenceID, givenName, surname, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText = BNGetFriendInfo(button.id) if(isOnline and client==BNET_CLIENT_WOW) then local hasFocus, toonName, client, realmName, faction, race, class, guild, zoneName, level, gameText, broadcastText, broadcastTime = BNGetToonInfo(toonID) - if(givenName and surname and toonName) then - if CanCooperateWithToon(toonID) then - nameText = format(BATTLENET_NAME_FORMAT, givenName, surname) ..' '.. FRIENDS_WOW_NAME_COLOR_CODE .. '(' .. ns.classColor[class] .. toonName .. FRIENDS_WOW_NAME_COLOR_CODE .. ')' - if(zoneName == playerArea) then - infoText = format('|cff00ff00%s|r', zoneName) - end + if(givenName and surname and toonName and class) then + -- color them all + --if CanCooperateWithToon(toonID) then + nameText = format(BATTLENET_NAME_FORMAT, givenName, surname) ..' '.. FRIENDS_WOW_NAME_COLOR_CODE .. '(' .. ns.classColor[class] .. ns.classColor[class] .. toonName .. FRIENDS_WOW_NAME_COLOR_CODE .. ')' + if(zoneName == playerArea) then + infoText = format('|cff00ff00%s|r', zoneName) end end end @@ -43,9 +43,6 @@ local function friendsFrame() if(nameText) then button.name:SetText(nameText) end - if(nameColor) then - button.name:SetTextColor(nameColor.r, nameColor.g, nameColor.b) - end if(infoText) then button.info:SetText(infoText) end -- 1.7.9.5