Looks like nameplates on classic behave differently than on modern.
Here's a more complete example with the changes.
Lua Code:
-- Nametag font size
local function SetFont(obj,optSize)
local fontName=obj:GetFont();
obj:SetFont(fontName,optSize,"THINOUTLINE");
end
SetFont(SystemFont_LargeNamePlate,8);
SetFont(SystemFont_NamePlate,8);
SetFont(SystemFont_LargeNamePlateFixed,8);
SetFont(SystemFont_NamePlateFixed,8);
-- Disable nametag colors
DefaultCompactNamePlateFriendlyFrameOptions.colorNameBySelection=false;
DefaultCompactNamePlateEnemyFrameOptions.colorNameBySelection=false;
DefaultCompactNamePlatePlayerFrameOptions.colorNameBySelection=false;
-- Move nametag
hooksecurefunc(NamePlateDriverFrame,"OnNamePlateCreated",function(_,base)-- Hook nameplate creation function
local unitframe=base.UnitFrame;-- UnitFrame attached to nameplate base
unitframe.name:ClearAllPoints();-- Clear nametag anchors
-- Set new anchor(s) here
unitframe.name:SetPoint("BOTTOM",unitframe.healthBar,"TOP",0,4);
end);
-- Remove realm names
hooksecurefunc("CompactUnitFrame_UpdateName",function(frame)
if ShouldShowName(frame) then
frame.name:SetVertexColor(1,1,1);-- Fixes tapped mobs permanently setting the nametag gray
frame.name:SetText(GetUnitName(frame.unit));
end
end);
Note: A recreation of the existing anchor is given to illustrate how to set an anchor from Lua. If you need more detail on the function, see
fontstring:SetPoint().