I tried
whoNa = string.match(whoT, "( %a+)$")
if who_friends[whoNa] then
and
if has_key(who_friends, whoNa) then
neither seemed to work.
also changed to what you had except with ~= since != errors out
Here's the whole thing if that helps.
if inv ~= nil then
local y = 0
for i, styles in ipairs (inv) do
local x = 5
for _, style in ipairs (styles) do
whoT = string.match (style.text, "^(.- %] %a+)")
if whoT == nil then
whoT = string.match(style.text, ".*")
if whoT == string.match(whoT, "^(.*Total.*)") then
x = x + WindowText (who_wind, "fontfour", whoT, 25, y + 1, 0, 0, colourGold)
end -- whoT double check
else
whoRa = string.match(whoT, "^(%a+ .-)")
whoCl = string.match(whoT, "^.-(%[.*%])")
whoNa = string.match(whoT, "( %a+)$")
if who_friends[whoNa] then
x = x + WindowText (who_wind, "fontfour", whoNa, x, y + 15, 0, 0, ColourNameToRGB("dodgerblue"))
elseif has_key(who_enemy, whoNa) then
x = x + WindowText (who_wind, "fontfour", whoNa, x, y + 15, 0, 0, ColourNameToRGB("red"))
else
x = x + WindowText (who_wind, "fontfour", whoNa, x, y + 15, 0, 0, style.textcolour)
end -- who_friends
if whoCl == nil then
-- if class is a colored name, it doesnt capture it, figure some fix for it here
else
WindowText (who_wind, "fontfour", whoCl, 80, y + 15, 0, 0, style.textcolour)
end -- whoCl
end -- whoT
end -- for
y = y + font_height
end -- for each who list item
else
WindowText (who_wind, "fontfour", "Who List will show up here", 25, 1, 0, 0, colourGold)
end -- inv
|