View Single Post
04-07-21, 05:28 PM   #4
DahkCeles
A Cliff Giant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 73
Building on what Xrystal wrote...

Code:
/run hooksecurefunc("CompactUnitFrame_UpdateName", function(self) if self.name then self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown") end end)

/run hooksecurefunc("UnitFrame_Update", function(self) if self.name then self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown") end end)
Or as an addon...

Lua Code:
  1. hooksecurefunc("CompactUnitFrame_UpdateName", function(self)
  2.     if self.name then
  3.         self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown")
  4.     end
  5. end)
  6.  
  7. hooksecurefunc("UnitFrame_Update", function(self)
  8.     if self.name then
  9.         self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown")
  10.     end
  11. end)

Last edited by DahkCeles : 04-07-21 at 05:31 PM.
  Reply With Quote