I'm getting a small issue with colouring my portrait overlay texture for my layout. As you can in the picture (
http://i36.tinypic.com/33yjey8.jpg) It colours by class quite happily but it paints normal mobs a quite unhealthy black. I want to get it so it colours by Unit Selection.
Code:
if UnitIsPlayer(unit) then
local _, class = UnitClass(unit)
t = self.colors.class[class]
elseif(not UnitIsPlayer(unit)) then
elseif(not UnitIsPlayer(unit)) then
local targetLevel = UnitLevel("target"); ----- Test.
t = GetDifficultyColor(targetLevel)
end
if (t) then
r, g, b = t[1], t[2], t[3]
else
r, g, b = {.7,.7,.7}
end
self.Health.bg:SetVertexColor(r,g,b)
if(unit=='player' or unit=='target') then
self.Portraitglosst:SetVertexColor(r,g,b)
end
Is what i use to colour it at the minute, and i have also tried
Code:
if UnitIsPlayer(unit) then
local _, class = UnitClass(unit)
t = self.colors.class[class]
elseif(not UnitIsPlayer(unit)) then
elseif(not UnitIsPlayer(unit)) then
t = UnitSelectionColor(unit)
end
if (t) then
r, g, b = t[1], t[2], t[3]
end
self.Health.bg:SetVertexColor(r,g,b)
if(unit=='player' or unit=='target') then
self.Portraitglosst:SetVertexColor(r,g,b)
end
Any ideas whats causing it to do this?