Thread Tools Display Modes
03-19-22, 09:19 PM   #1
muleyo
A Deviate Faerie Dragon
Join Date: Apr 2021
Posts: 12
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)
  Reply With Quote
03-19-22, 10:40 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Originally Posted by muleyo View Post
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
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Hide names from nameplates except from target

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off