From 7bb5b9fda4224477d873bda354f2d93bb522377d Mon Sep 17 00:00:00 2001 From: Laxxz Date: Sun, 13 Sep 2026 04:13:29 -0300 Subject: [PATCH] Nameplates: apply the configured outline to friendly player names In name-only mode, ApplyFriendlyFontOverride read the flags back off SystemFont_NamePlate / SystemFont_NamePlate_Outlined and only fell through to GetNPOutline() when they were nil. Blizzard's stock font objects always carry non-nil flags, so the configured outline was never applied: friendly player names kept Blizzard's flags while the friendly NPC overlays, which call GetNPOutline() directly, honoured the setting. Stamp GetNPOutline() on both font objects directly, and fold the flags into the file/size stamp so an outline change re-applies instead of being skipped as unchanged. Fixes #1653 Co-Authored-By: Claude Opus 5 --- .../EllesmereUINameplatesFriendly.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/EllesmereUINameplates/EllesmereUINameplatesFriendly.lua b/EllesmereUINameplates/EllesmereUINameplatesFriendly.lua index 7803c917c..103ee621e 100644 --- a/EllesmereUINameplates/EllesmereUINameplatesFriendly.lua +++ b/EllesmereUINameplates/EllesmereUINameplatesFriendly.lua @@ -206,11 +206,12 @@ local function ApplySubtitleFont() end ApplySubtitleFont() -local _ffFile, _ffSize +local _ffFile, _ffSize, _ffFlags local function ApplyFriendlyFontOverride(force) SaveOriginalFonts() local font = GetFont() local size = GetFriendlyNameSize() + local flags = GetNPOutline() -- Blizzard never rewrites the shared font OBJECTS (its plate setup only -- SetFontObjects the name strings onto them), so once they carry our -- file + size they keep it: an unchanged pair means nothing to restore @@ -220,7 +221,7 @@ local function ApplyFriendlyFontOverride(force) -- (instanced content) the per-string SetTextHeight re-stamp is denied, -- and this relayout is the only lever that clears Blizzard's per-instance -- height, so the deferred re-apply forces it there (once per burst). - if not force and fontOverrideApplied and font == _ffFile and size == _ffSize then return end + if not force and fontOverrideApplied and font == _ffFile and size == _ffSize and flags == _ffFlags then return end -- Restore to known-good originals first so we read the correct height -- even if Blizzard reset the font objects after a CVar change. if fontOverrideApplied then @@ -232,15 +233,17 @@ local function ApplyFriendlyFontOverride(force) end fontOverrideApplied = false end + -- Stamp the configured outline directly. The stock font objects always + -- carry non-nil flags, so reading them back and only falling through to + -- GetNPOutline() when nil never reached the setting: friendly player + -- names kept Blizzard's flags while the NPC overlays honoured it. if SystemFont_NamePlate and SystemFont_NamePlate.SetFont then - local _, _, flags = SystemFont_NamePlate:GetFont() - SystemFont_NamePlate:SetFont(font, size, flags or GetNPOutline()) + SystemFont_NamePlate:SetFont(font, size, flags) end if SystemFont_NamePlate_Outlined and SystemFont_NamePlate_Outlined.SetFont then - local _, _, flags = SystemFont_NamePlate_Outlined:GetFont() - SystemFont_NamePlate_Outlined:SetFont(font, size, flags or GetNPOutline()) + SystemFont_NamePlate_Outlined:SetFont(font, size, flags) end - _ffFile, _ffSize = font, size + _ffFile, _ffSize, _ffFlags = font, size, flags fontOverrideApplied = true end