oh my .. I totally forgot the return statement. I thought it was supposed to lead back to that line with the atlas doing its stuff behind the scenes ..
Thanks, made me check their code again as I thought I had done the exact same thing they did rofl.
Lua Code:
if ( UnitFrame_ShouldReplacePortrait(self) ) then
local _, class = UnitClass(self.unit);
if ( class ) then
local classIconAtlas = GetClassAtlas(class);
if ( classIconAtlas ) then
self.portrait:SetAtlas(classIconAtlas);
return; <<<< I missed this line
end
end
end
SetPortraitTexture(self.portrait, self.unit, self.disablePortraitMask);
Ended up doing this in my code. It shouldn't get to the useClassIcon else statements but if they do they're covered with the old fashioned class icon files ( until they disappear ) unless the class part fails for some strange reason. With the "player" part replaced with unitFrame.unit for completeness ( not that I have the other units working yet rofl.)
Lua Code:
if useClassIcon == "1" then
local _, class = UnitClass(unitFrame.unit)
if class then
local classIconAtlas = GetClassAtlas(class)
if classIconAtlas then
unitFrame.Portrait.Icon:SetAtlas(classIconAtlas)
else
unitFrame.Portrait.Icon:SetTexture("Interface\\ICONS\\ClassIcon_" .. class)
end
else
SetPortraitTexture(unitFrame.Portrait.Icon, "player",false)
end
else
SetPortraitTexture(unitFrame.Portrait.Icon, "player",false)
end