WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Hide names from nameplates except from target (https://www.wowinterface.com/forums/showthread.php?t=59072)

muleyo 03-19-22 09:19 PM

Hide names from nameplates except from target
 
Hi,

I'd like to hide names from nameplates except from my current target. Unfortunately, I only found code to hide all player names.

Code:

hooksecurefunc("CompactUnitFrame_UpdateName", function(frame)
        if strsub(frame.unit, 1, 9) == "nameplate" then
                frame.name:Hide()
        end
end)


Dridzt 03-19-22 10:40 PM

Quote:

Originally Posted by muleyo (Post 340435)
Hi,

I'd like to hide names from nameplates except from my current target. Unfortunately, I only found code to hide all player names.

Code:

hooksecurefunc("CompactUnitFrame_UpdateName", function(frame)
        if strsub(frame.unit, 1, 9) == "nameplate" then
                frame.name:Hide()
        end
end)


Code:

hooksecurefunc("CompactUnitFrame_UpdateName", function(frame)
  if strsub(frame.unit, 1, 9) == "nameplate" then
    if not UnitIsUnit(frame.unit, "target") then
      frame.name:Hide()
    end
  end
end)

Untested


All times are GMT -6. The time now is 12:53 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI