I prefer to use the default nameplates, but I’d like to change the font colour from red to white. I don’t need all the extras that come with nameplate addons, so I don’t use them anymore.
Not much came up in a Google search, but since addons can do this, there must be a way to change just the font colour.
Can anyone help?
Thanks
Copy paste the following into the website addon.bool.no
to create/download an addon to change the colours (for enemy names)
local function ChangeColor(self)
local unit = self:GetParent().unit
if UnitIsEnemy("player", unit) then
self:SetTextColor(1, 1, 1)
end
end
local f = CreateFrame("Frame")
f:RegisterEvent("NAME_PLATE_UNIT_ADDED")
f:SetScript("OnEvent", function(_, _, unitId)
local unit = C_NamePlate.GetNamePlateForUnit(unitId).UnitFrame
if not unit.hookedForColor then
unit.hookedForColor = true
hooksecurefunc(unit.name, "SetVertexColor", ChangeColor)
end
end)
2 Likes
Is this script only for enemy player nameplate name text? Is there a script or addon that changes every name text to white or yellow and not just players?
The colour changes names for players, NPCs, creatures etc. to white if the are “hostile” to you.
To remove the condition, you can comment out/remove the
if .. end
around
self:SetTextColor(1, 1, 1)
That will make every name white regardless of status/standing (change 1, 1, 1
to 1, 1, 0
for yellow). It won’t differentiate tapped or dead etc. units.
Or, you can add if/elseif
statements to make the colour anything you want depending on the contitions.
1 Like
This worked! Thank you so much, it’s just what I was looking for!
Edit- actually… I hate to ask for more, but is there a way to alter this slightly so that every name appears white, even the neutral mobs? Either way, this was such a huge help, and I really appreciate your time!
Thank you
Modifying the ChangeColor function to the following should make every nameplate’s name text white.
local function ChangeColor(self)
local unit = self:GetParent().unit
self:SetTextColor(1, 1, 1)
end
1 Like
I can’t thank you enough… this is perfect.
1 Like