Hi, I'm trying to have
these race icons to the portrait of my unit frames (player, target, targettarget, arena1, etc...) in the same spirit as the few addons who allow you to have the class icons to portraits. All these addons use a similar structure like this one:
Lua Code:
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)
I attempted some modifications by my own, of course it resulted nothing...
I presume that I should replace "CLASS_ICON_TCOORDS" by "RACE_ICON_TCOORDS", add "UnitSex" and replace "UnitClass" by "UnitRace".
Maybe it needs more changes or another structure. Honnestly I don't know, I'm lost with many questions like: UnitGUID wouldn't be better? / What about C_PlayerInfo.GetRace? Etc... I can't even figure if what I ask for is possible or not.
My knowledge are very limited in coding, I think I'm able to read and nearly understand line after line
but not to write it all by myself without some guidance. Could someone help me with this?