diff --git a/EllesmereUINameplates/EllesmereUINameplates.lua b/EllesmereUINameplates/EllesmereUINameplates.lua index e6df9ce06..6af55cef2 100644 --- a/EllesmereUINameplates/EllesmereUINameplates.lua +++ b/EllesmereUINameplates/EllesmereUINameplates.lua @@ -139,6 +139,7 @@ function ns._appendDisplayPresetKeys(t) end local defaults = { + arenaNumberNames = "none", absorbStyle = "blizzard", absorbCleanAlpha = 30, absorbColor = { r = 1, g = 1, b = 1 }, @@ -6952,6 +6953,32 @@ function NameplateFrame:UpdateName() el = el and GetTextSlot(el) or "enemyName" local name = UnitName(unit) if type(name) == "string" then + if p and p.arenaNumberNames and p.arenaNumberNames ~= "none" then + local _, instanceType = IsInInstance() + if instanceType == "arena" then + for i = 1, 3 do + local aUnit = "arena" .. i + local isMatch = UnitIsUnit(unit, aUnit) + if not isMatch then + local ok, match = pcall(function() return name and name == UnitName(aUnit) end) + isMatch = ok and match + end + + if isMatch then + local safeName = UnitName(aUnit) or "Unknown" + if p.arenaNumberNames == "full" then + name = tostring(i) + elseif p.arenaNumberNames == "prefix" then + name = tostring(i) .. " " .. safeName + elseif p.arenaNumberNames == "postfix" then + name = safeName .. " " .. tostring(i) + end + break + end + end + end + end + ns.SetNameElementText(self.name, el, name, unit) if p and p.nameRaidMarkerEnabled == true then self:RefreshNamePosition(true) end end diff --git a/EllesmereUIOptions/EUI_Nameplates_Options.lua b/EllesmereUIOptions/EUI_Nameplates_Options.lua index 88054ae8c..d1e0ed013 100644 --- a/EllesmereUIOptions/EUI_Nameplates_Options.lua +++ b/EllesmereUIOptions/EUI_Nameplates_Options.lua @@ -4164,24 +4164,35 @@ initFrame:SetScript("OnEvent", function(self) if ns.ApplyOOCPlates then ns.ApplyOOCPlates() end end }); y = y - h - -- Row 6 (Blood Death Knight only): Hide Copies of Blood Plague. The row - -- is not built at all for anyone else -- the setting only affects a - -- debuff Blood spec applies. - do - local _, classFile = UnitClass("player") - local specIdx = GetSpecialization and GetSpecialization() - local specID = specIdx and GetSpecializationInfo(specIdx) - if classFile == "DEATHKNIGHT" and specID == 250 then - _, h = W:DualRow(parent, y, - { type="toggle", text="Hide Copies of Blood Plague", - tooltip="Shows a single Blood Plague debuff on enemy nameplates instead of one per copy (Blood Boil from weapon copies).", - getValue=function() return DBVal("hideBloodPlagueCopies") ~= false end, - setValue=function(v) - DB().hideBloodPlagueCopies = v - if ns.NPC_ReloadAll then ns.NPC_ReloadAll() end - end }, - { type="label", text="" }); y = y - h + -- Row 6: Class-specific options and Arena Number Names + local arenaConfig = { + type="dropdown", text="Arena Number Names", + tooltip="Changes how enemy names are displayed in arenas based on their arena target number (e.g., arena1, arena2).", + values={ none="Disabled", full="Full Replacement (1, 2, 3)", prefix="Prefix (1 Name)", postfix="Postfix (Name 1)" }, + order={ "none", "full", "prefix", "postfix" }, + getValue=function() return DBVal("arenaNumberNames") or "none" end, + setValue=function(v) + DB().arenaNumberNames = v + if ns.RefreshAllSettings then ns.RefreshAllSettings() end + UpdatePreview() end + } + + local _, classFile = UnitClass("player") + local specIdx = GetSpecialization and GetSpecialization() + local specID = specIdx and GetSpecializationInfo(specIdx) + if classFile == "DEATHKNIGHT" and specID == 250 then + _, h = W:DualRow(parent, y, + { type="toggle", text="Hide Copies of Blood Plague", + tooltip="Shows a single Blood Plague debuff on enemy nameplates instead of one per copy (Blood Boil from weapon copies).", + getValue=function() return DBVal("hideBloodPlagueCopies") ~= false end, + setValue=function(v) + DB().hideBloodPlagueCopies = v + if ns.NPC_ReloadAll then ns.NPC_ReloadAll() end + end }, + arenaConfig); y = y - h + else + _, h = W:DualRow(parent, y, arenaConfig, { type="label", text="" }); y = y - h end return math.abs(y)