View Single Post
08-21-21, 09:45 PM   #5
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by Nagí View Post
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.

Oof, I should have tested that more. I'm not that familiar with textures as you can see
This doesn't seem to give a massive FPS drop, but still gives you a 5-10 FPS hit. which is not good
Lua Code:
  1. local genders = {nil, "male", "female"}
  2.  
  3. hooksecurefunc("UnitFramePortrait_Update",function(self)
  4.     if self.portrait and UnitIsPlayer(self.unit) then
  5.         local _, race = UnitRace(self.unit)
  6.         local sexID = UnitSex(self.unit)
  7.         local atlas = GetRaceAtlas(race:lower(), genders[sexID], true)
  8.         self.portrait:SetAtlas(atlas)
  9.         if not self.portrait.hasMask then
  10.             self.portrait:SetMask("Interface\\CharacterFrame\\TempPortraitAlphaMask")
  11.             self.portrait.hasMask = true
  12.         end
  13.     end
  14. end)

Last edited by Ketho : 08-21-21 at 09:54 PM.
  Reply With Quote