Description
=== Works with any patch version from 4.0.0 and up so far ===
A very small addon which shows class icon instead of a portrait for player-controlled characters (both your and opposing faction). Does not change portraits of pets, mobs and NPCs.
Here is the complete sourcecode (yes it is THAT small):
hooksecurefunc("UnitFramePortrait_Update",function(self)
if self.portrait then
if UnitIsPlayer(self.unit) then
local t = CLASS_ICON_TCOORDS[select(2,UnitClass(self.unit))]
if t then
self.portrait:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
self.portrait:SetTexCoord(unpack(t))
end
else
self.portrait:SetTexCoord(0,1,0,1)
end
end
end);
Should work with any localization. This addon is a lightweight alternative to ClassPortraits (currently not working for me in 4.0.1) and ClassIcons_Reborn addons. I found original script for this addon on Arena Junkies and modified it a bit (better textures, player characters filter).
NOTE:
Asignupsucks said (Sun Nov 28 2010, see in comments below):
If you add this after the second line [in World of Warcraft\Interface\Addons\ClassPortraitsFinal\ClassPortraitsFinal.lua], you will not see your own classicon, but still those of others:
if self.unit == "player" or self.unit == "pet" then return end



