Amazing! Thanks a lot to both of you for your time and your consideration. I searched a bit before dare to ask for help and I have already seen
SetAtlas() while looking in the folders of the Interface with
Notepad++. But I have never thought about using it.
I have tried both scripts. First the one from Ketho's post causes me massive FPS drops. When entering in combat with a training dummy everything is normal. But when in combat with a NPC who is targeting me, my FPS fall and are locked at ~20.
Then the one from SDPhantom's post works great. But after that I add the line with
SetMask() from Ketho's code like this:
Lua Code:
hooksecurefunc("UnitFramePortrait_Update",function(self)
if self.portrait then
if UnitIsPlayer(self.unit) then
self.portrait:SetMask("Interface\\CharacterFrame\\TempPortraitAlphaMask");
self.portrait:SetAtlas(GetRaceAtlas(
select(2,UnitRace(self.unit)):lower()
,UnitSex(self.unit)==Enum.Unitsex.Male and "male" or "female"
,true
));
else
self.portrait:SetTexCoord(0,1,0,1);
end
end
end);
...when in combat against NPC same issue with FPS drops.
I thought this was a problem of compatibility with one of my AddOns.
At start I have downloaded
AddonUsage to know the source of the issue.
(*cough* I will make another post about DSM)
I check
with AddOns and
without AddOns
So, I presume that the problem is the use of
SetMask() or the update during combat itself.
I'm quite curious to know what is the difference between
SetMask() and
SetPortraitToTexture() here? And if
SetPortraitToTexture() would cause the same issue?
(I attempted SetPortraitToTexture() but I didn't succeed to make it works, I haven't put the good informations certainly...)
Also I want to flip horizontally the portrait for the unit frame of my target and focus.
I have tried to do by myself, but I'm not too sure where to insert the elements.
I guess that I should use
SetTexCoord(1, 0, 0, 1) for flip the icon, and probably assign the specific units with a new
local unit =