From 934a9795025cb0962edce01438590792495823ab Mon Sep 17 00:00:00 2001 From: yaroot Date: Mon, 18 Oct 2010 19:46:03 +0800 Subject: [PATCH] fix wholist --- who.lua | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/who.lua b/who.lua index 8679de4..39ffcef 100644 --- a/who.lua +++ b/who.lua @@ -1,23 +1,21 @@ -if(1) then return end +local parent, ns = ... -if(enable_wholist) then - hooksecurefunc('WhoList_Update', function() - local whoIndex - local whoOffset = FauxScrollFrame_GetOffset(WhoListScrollFrame) - - local playerZone = GetRealZoneText() - local playerGuild = GetGuildInfo'player' - local playerRace = UnitRace'player' - - for i=1, WHOS_TO_DISPLAY, 1 do - whoIndex = whoOffset + i - local nameText = getglobal('WhoFrameButton'..i..'Name') - local levelText = getglobal('WhoFrameButton'..i..'Level') - local classText = getglobal('WhoFrameButton'..i..'Class') - local variableText = getglobal('WhoFrameButton'..i..'Variable') - - local name, guild, level, race, class, zone, classFileName = GetWhoInfo(whoIndex) - if not name then return end +hooksecurefunc('WhoList_Update', function() + local whoOffset = FauxScrollFrame_GetOffset(WhoListScrollFrame) + + local playerZone = GetRealZoneText() + local playerGuild = GetGuildInfo'player' + local playerRace = UnitRace'player' + + for i=1, WHOS_TO_DISPLAY, 1 do + local index = whoOffset + i + local nameText = getglobal('WhoFrameButton'..i..'Name') + local levelText = getglobal('WhoFrameButton'..i..'Level') + local classText = getglobal('WhoFrameButton'..i..'Class') + local variableText = getglobal('WhoFrameButton'..i..'Variable') + + local name, guild, level, race, class, zone, classFileName = GetWhoInfo(index) + if(name) then if zone == playerZone then zone = '|cff00ff00' .. zone end @@ -28,11 +26,11 @@ if(enable_wholist) then race = '|cff00ff00' .. race end local columnTable = { zone, guild, race } - - nameText:SetVertexColor(unpack(classColors[class])) - levelText:SetText(diffColor[level] .. level) + + nameText:SetText(ns.classColor[classFileName] .. name) + levelText:SetText(ns.diffColor[level] .. level) variableText:SetText(columnTable[UIDropDownMenu_GetSelectedID(WhoFrameDropDown)]) end - end) -end + end +end) -- 1.7.9.5