From 7b040214b35403223750cbde0b4f67001f2e2a50 Mon Sep 17 00:00:00 2001 From: Mitchell Monaghan Date: Wed, 11 Mar 2026 18:03:55 -0500 Subject: [PATCH 1/2] Added new text for displaying party numbers. --- Config.lua | 24 +++++++ Core.lua | 22 +++++++ Features/ElementAppearance.lua | 50 +++++++++++++++ Frames/Core.lua | 111 +++++++++++++++++++++++++++++++++ Frames/Create.lua | 28 +++++++++ Frames/Update.lua | 41 +++++++++++- Options/AutoProfiles.lua | 1 + Options/Options.lua | 53 +++++++++++++++- TestMode/TestMode.lua | 27 ++++++++ 9 files changed, 355 insertions(+), 2 deletions(-) diff --git a/Config.lua b/Config.lua index 38cd414..4d30456 100644 --- a/Config.lua +++ b/Config.lua @@ -1332,6 +1332,18 @@ DF.PartyDefaults = { nameTextX = 0, nameTextY = -10, + -- Party Number Text + partyIndexTextAnchor = "TOPLEFT", + partyIndexTextColor = {r = 1, g = 1, b = 1, a = 1}, + partyIndexTextEnabled = false, + partyIndexTextFont = "DF Roboto SemiBold", + partyIndexTextFontSize = 10, + partyIndexTextOutline = "SHADOW", + partyIndexTextPlayerAtBottom = false, + partyIndexTextUseClassColor = false, + partyIndexTextX = 2, + partyIndexTextY = -2, + -- Out of Range oorAbsorbBarAlpha = 0.20000000298023, oorAurasAlpha = 0.20000000298023, @@ -2539,6 +2551,18 @@ DF.RaidDefaults = { nameTextX = 0, nameTextY = -10, + -- Party Number Text + partyIndexTextAnchor = "TOPLEFT", + partyIndexTextColor = {r = 1, g = 1, b = 1, a = 1}, + partyIndexTextEnabled = false, + partyIndexTextFont = "DF Roboto SemiBold", + partyIndexTextFontSize = 10, + partyIndexTextOutline = "SHADOW", + partyIndexTextPlayerAtBottom = false, + partyIndexTextUseClassColor = false, + partyIndexTextX = 2, + partyIndexTextY = -2, + -- Out of Range oorAbsorbBarAlpha = 0.20000000298023, oorAurasAlpha = 0.20000000298023, diff --git a/Core.lua b/Core.lua index 88090d9..fa79543 100644 --- a/Core.lua +++ b/Core.lua @@ -533,6 +533,12 @@ function DF:LightweightUpdateFontSize(textType) if fontOutline == "NONE" then fontOutline = "" end local size = db.statusTextFontSize or 10 DF:SafeSetFont(frame.statusText, fontPath, size, fontOutline) + elseif textType == "partyIndex" and frame.partyIndexText then + local fontPath = db.partyIndexTextFont or "Fonts\\FRIZQT__.TTF" + local fontOutline = db.partyIndexTextOutline or "OUTLINE" + if fontOutline == "NONE" then fontOutline = "" end + local size = db.partyIndexTextFontSize or 10 + DF:SafeSetFont(frame.partyIndexText, fontPath, size, fontOutline) end end @@ -560,6 +566,10 @@ function DF:LightweightUpdateTextPosition(textType) frame.statusText:ClearAllPoints() local anchor = db.statusTextAnchor or "BOTTOM" frame.statusText:SetPoint(anchor, frame, anchor, db.statusTextX or 0, db.statusTextY or 0) + elseif textType == "partyIndex" and frame.partyIndexText then + frame.partyIndexText:ClearAllPoints() + local anchor = db.partyIndexTextAnchor or "TOPLEFT" + frame.partyIndexText:SetPoint(anchor, frame, anchor, db.partyIndexTextX or 2, db.partyIndexTextY or -2) end end @@ -1927,6 +1937,10 @@ function DF:LightweightUpdateTextColor(textType) elseif textType == "status" then colorKey = "statusTextColor" textKey = "statusText" + elseif textType == "partyIndex" then + if db.partyIndexTextUseClassColor then return end + colorKey = "partyIndexTextColor" + textKey = "partyIndexText" else return end @@ -1958,6 +1972,12 @@ function DF:LightweightUpdateTextColor(textType) else alpha = db.rangeFadeAlpha or 0.55 end + elseif textType == "partyIndex" then + if db.oorEnabled then + alpha = db.oorNameTextAlpha or 0.55 + else + alpha = db.rangeFadeAlpha or 0.55 + end end -- Dead fade only applies when in range elseif testData.status and db.fadeDeadFrames then @@ -1965,6 +1985,8 @@ function DF:LightweightUpdateTextColor(textType) alpha = db.fadeDeadName or 1.0 elseif textType == "status" then alpha = db.fadeDeadStatusText or 1.0 + elseif textType == "partyIndex" then + alpha = db.fadeDeadName or 1.0 end end end diff --git a/Features/ElementAppearance.lua b/Features/ElementAppearance.lua index 4eecdb5..2086de0 100644 --- a/Features/ElementAppearance.lua +++ b/Features/ElementAppearance.lua @@ -538,6 +538,54 @@ function DF:UpdateStatusTextAppearance(frame) frame.statusText:SetAlpha(alpha) end +-- ============================================================ +-- PARTY INDEX TEXT APPEARANCE +-- ============================================================ + +function DF:UpdatePartyIndexTextAppearance(frame) + if not IsDandersFrame(frame) then return end + if not frame.partyIndexText then return end + + local db = GetDB(frame) + if not db then return end + + if db.partyIndexTextEnabled == false then + frame.partyIndexText:Hide() + return + end + + local deadOrOffline = IsDeadOrOffline(frame) + local inRange = GetInRange(frame) + + local r, g, b = 1, 1, 1 + local baseAlpha = 1.0 + + if db.partyIndexTextUseClassColor then + local classColor = GetClassColor(frame) + r, g, b = classColor.r, classColor.g, classColor.b + elseif deadOrOffline then + r, g, b = 0.5, 0.5, 0.5 + else + local c = db.partyIndexTextColor or DEFAULT_COLOR_WHITE + r, g, b = c.r, c.g, c.b + baseAlpha = c.a or 1.0 + end + + local alpha = baseAlpha + if deadOrOffline and db.fadeDeadFrames then + alpha = db.fadeDeadName or 1.0 + end + + frame.partyIndexText:SetTextColor(r, g, b, 1.0) + + if db.oorEnabled then + local oorAlpha = db.oorNameTextAlpha or 1 + ApplyOORAlpha(frame.partyIndexText, inRange, alpha, oorAlpha) + else + frame.partyIndexText:SetAlpha(alpha) + end +end + -- ============================================================ -- POWER BAR APPEARANCE -- ============================================================ @@ -1146,6 +1194,7 @@ function DF:UpdateAllElementAppearances(frame) DF:UpdateNameTextAppearance(frame) DF:UpdateHealthTextAppearance(frame) DF:UpdateStatusTextAppearance(frame) + DF:UpdatePartyIndexTextAppearance(frame) DF:UpdatePowerBarAppearance(frame) DF:UpdateBuffIconsAppearance(frame) DF:UpdateDebuffIconsAppearance(frame) @@ -1217,6 +1266,7 @@ DF.UpdateBackgroundAlpha = DF.UpdateBackgroundAppearance DF.UpdateNameTextAlpha = DF.UpdateNameTextAppearance DF.UpdateHealthTextAlpha = DF.UpdateHealthTextAppearance DF.UpdateStatusTextAlpha = DF.UpdateStatusTextAppearance +DF.UpdatePartyIndexTextAlpha = DF.UpdatePartyIndexTextAppearance DF.UpdatePowerBarAlpha = DF.UpdatePowerBarAppearance DF.UpdateBuffIconsAlpha = DF.UpdateBuffIconsAppearance DF.UpdateDebuffIconsAlpha = DF.UpdateDebuffIconsAppearance diff --git a/Frames/Core.lua b/Frames/Core.lua index 3bf5734..4566786 100644 --- a/Frames/Core.lua +++ b/Frames/Core.lua @@ -473,6 +473,117 @@ function DF:GetUnitName(unit) return UnitName(unit) or unit end +-- Update name text on a frame - uses GetUnitName which can be overridden +function DF:UpdateNameText(frame) + if not frame or not frame.nameText or not frame.unit then return end + + local unit = frame.unit + local db = frame.isRaidFrame and DF:GetRaidDB() or DF:GetDB() + + -- Get name using the overridable method + local name = DF:GetUnitName(unit) or unit + + -- Apply truncation if configured (UTF-8 aware) + local nameLength = db.nameTextLength or 0 + if nameLength > 0 and name and DF:UTF8Len(name) > nameLength then + if db.nameTextTruncateMode == "ELLIPSIS" then + name = DF:UTF8Sub(name, 1, nameLength) .. "..." + else + name = DF:UTF8Sub(name, 1, nameLength) + end + end + + frame.nameText:SetText(name) + + -- Get class for class-colored elements + local _, class = UnitClass(unit) + local classColor = class and DF:GetClassColor(class) + + -- Apply name color + if db.nameTextUseClassColor and classColor then + frame.nameText:SetTextColor(classColor.r, classColor.g, classColor.b, 1) + else + local nameColor = db.nameTextColor or {r = 1, g = 1, b = 1} + frame.nameText:SetTextColor(nameColor.r, nameColor.g, nameColor.b, 1) + end + + -- Apply health text class color if enabled + if db.healthTextUseClassColor and classColor and frame.healthText then + frame.healthText:SetTextColor(classColor.r, classColor.g, classColor.b, 1) + end +end + +-- Get the displayed party/raid index for a unit token. +-- Party mode default: player=1, party1=2 ... party4=5 +-- Optional remap mode: party1=1 ... party4=4, player=5 +-- Raid mode: raid1 ... raid40 +function DF:GetUnitPartyIndex(unit, db) + if not unit or unit == "" then return nil end + + local raidTokenIndex = unit:match("^raid(%d+)$") + if raidTokenIndex then + return tonumber(raidTokenIndex) + end + + local raidIndex = UnitInRaid(unit) + if raidIndex and raidIndex > 0 then + return raidIndex + end + + local partyTokenIndex = unit:match("^party(%d+)$") + if partyTokenIndex then + if db and db.partyIndexTextPlayerAtBottom then + return tonumber(partyTokenIndex) + end + return tonumber(partyTokenIndex) + 1 + end + + if UnitIsUnit(unit, "player") then + if db and db.partyIndexTextPlayerAtBottom then + return 5 + end + return 1 + end + + return nil +end + +function DF:UpdatePartyIndexText(frame) + if not frame or not frame.partyIndexText or not frame.unit then return end + + local db = frame.isRaidFrame and DF:GetRaidDB() or DF:GetDB() + if not db then return end + + if db.partyIndexTextEnabled == false then + frame.partyIndexText:SetText("") + frame.partyIndexText:Hide() + return + end + + local index = DF:GetUnitPartyIndex(frame.unit, db) + if not index then + frame.partyIndexText:SetText("") + frame.partyIndexText:Hide() + return + end + + frame.partyIndexText:SetText(tostring(index)) + frame.partyIndexText:Show() + + if DF.UpdatePartyIndexTextAppearance then + DF:UpdatePartyIndexTextAppearance(frame) + elseif db.partyIndexTextUseClassColor then + local _, class = UnitClass(frame.unit) + local classColor = class and DF:GetClassColor(class) + if classColor then + frame.partyIndexText:SetTextColor(classColor.r, classColor.g, classColor.b, 1) + end + else + local c = db.partyIndexTextColor or {r = 1, g = 1, b = 1} + frame.partyIndexText:SetTextColor(c.r, c.g, c.b, c.a or 1) + end +end + -- Iterator for all compact unit frames (player, party, raid) -- Accepts a callback function OR returns an iterator if no callback provided -- Usage with callback: DF:IterateCompactFrames(function(frame) ... end) diff --git a/Frames/Create.lua b/Frames/Create.lua index bf90028..a974aa4 100755 --- a/Frames/Create.lua +++ b/Frames/Create.lua @@ -634,6 +634,20 @@ function DF:CreateFrameElements(frame, isRaid) frame.statusText:SetTextColor(statusColor.r, statusColor.g, statusColor.b, 1) frame.statusText:SetDrawLayer("OVERLAY", 7) frame.statusText:Hide() + + -- ======================================== + -- PARTY INDEX TEXT + -- ======================================== + frame.partyIndexText = frame.contentOverlay:CreateFontString(nil, "OVERLAY") + local partyIndexOutline = db.partyIndexTextOutline or "OUTLINE" + if partyIndexOutline == "NONE" then partyIndexOutline = "" end + DF:SafeSetFont(frame.partyIndexText, db.partyIndexTextFont or "Fonts\\FRIZQT__.TTF", db.partyIndexTextFontSize or 10, partyIndexOutline) + local partyIndexAnchor = db.partyIndexTextAnchor or "TOPLEFT" + frame.partyIndexText:SetPoint(partyIndexAnchor, frame, partyIndexAnchor, db.partyIndexTextX or 2, db.partyIndexTextY or -2) + local partyIndexColor = db.partyIndexTextColor or {r = 1, g = 1, b = 1} + frame.partyIndexText:SetTextColor(partyIndexColor.r, partyIndexColor.g, partyIndexColor.b, partyIndexColor.a or 1) + frame.partyIndexText:SetDrawLayer("OVERLAY", 7) + frame.partyIndexText:Hide() -- Continue with the rest of the elements... -- (Border, icons, power bar, auras, absorbs, etc.) @@ -1344,6 +1358,20 @@ function DF:CreateUnitFrame(unit, index, isRaid) frame.statusText:SetTextColor(statusColor.r, statusColor.g, statusColor.b, 1) frame.statusText:SetDrawLayer("OVERLAY", 7) frame.statusText:Hide() + + -- ======================================== + -- PARTY INDEX TEXT + -- ======================================== + frame.partyIndexText = frame.contentOverlay:CreateFontString(nil, "OVERLAY") + local partyIndexOutline = db.partyIndexTextOutline or "OUTLINE" + if partyIndexOutline == "NONE" then partyIndexOutline = "" end + DF:SafeSetFont(frame.partyIndexText, db.partyIndexTextFont or "Fonts\\FRIZQT__.TTF", db.partyIndexTextFontSize or 10, partyIndexOutline) + local partyIndexAnchor = db.partyIndexTextAnchor or "TOPLEFT" + frame.partyIndexText:SetPoint(partyIndexAnchor, frame, partyIndexAnchor, db.partyIndexTextX or 2, db.partyIndexTextY or -2) + local partyIndexColor = db.partyIndexTextColor or {r = 1, g = 1, b = 1} + frame.partyIndexText:SetTextColor(partyIndexColor.r, partyIndexColor.g, partyIndexColor.b, partyIndexColor.a or 1) + frame.partyIndexText:SetDrawLayer("OVERLAY", 7) + frame.partyIndexText:Hide() -- ======================================== -- BORDER diff --git a/Frames/Update.lua b/Frames/Update.lua index 889ebb9..b19a719 100644 --- a/Frames/Update.lua +++ b/Frames/Update.lua @@ -291,6 +291,29 @@ function DF:ApplyFrameLayout(frame) frame.statusText:SetTextColor(statusColor.r, statusColor.g, statusColor.b, statusColor.a or 1) end end + + -- ======================================== + -- PARTY INDEX TEXT + -- ======================================== + if frame.partyIndexText then + local partyIndexFont = db.partyIndexTextFont or "Fonts\\FRIZQT__.TTF" + local partyIndexFontSize = db.partyIndexTextFontSize or 10 + local partyIndexOutline = db.partyIndexTextOutline or "OUTLINE" + if partyIndexOutline == "NONE" then partyIndexOutline = "" end + + DF:SafeSetFont(frame.partyIndexText, partyIndexFont, partyIndexFontSize, partyIndexOutline) + + local partyIndexAnchor = db.partyIndexTextAnchor or "TOPLEFT" + frame.partyIndexText:ClearAllPoints() + frame.partyIndexText:SetPoint(partyIndexAnchor, frame, partyIndexAnchor, db.partyIndexTextX or 2, db.partyIndexTextY or -2) + + if DF.UpdatePartyIndexTextAppearance then + DF:UpdatePartyIndexTextAppearance(frame) + elseif not db.partyIndexTextUseClassColor then + local partyIndexColor = db.partyIndexTextColor or {r = 1, g = 1, b = 1, a = 1} + frame.partyIndexText:SetTextColor(partyIndexColor.r, partyIndexColor.g, partyIndexColor.b, partyIndexColor.a or 1) + end + end -- ======================================== -- ROLE ICON @@ -559,6 +582,7 @@ function DF:UpdateUnitFrame(frame, source) frame.statusText:Hide() end end + DF:UpdatePartyIndexText(frame) if frame.healthText then frame.healthText:Hide() end @@ -612,6 +636,7 @@ function DF:UpdateUnitFrame(frame, source) frame.statusText:Hide() end end + DF:UpdatePartyIndexText(frame) if frame.healthText then frame.healthText:Hide() end @@ -774,6 +799,11 @@ function DF:UpdateUnitFrame(frame, source) -- ======================================== DF:UpdateName(frame) + -- ======================================== + -- PARTY INDEX + -- ======================================== + DF:UpdatePartyIndexText(frame) + -- ======================================== -- HEALTH TEXT -- ======================================== @@ -1773,6 +1803,15 @@ local function RefreshFrameFonts(frame, db) if statusOutline == "NONE" then statusOutline = "" end DF:SafeSetFont(frame.statusText, statusFont, statusFontSize, statusOutline) end + + -- Party index text + if frame.partyIndexText then + local partyIndexFont = db.partyIndexTextFont or "Fonts\\FRIZQT__.TTF" + local partyIndexFontSize = db.partyIndexTextFontSize or 10 + local partyIndexOutline = db.partyIndexTextOutline or "OUTLINE" + if partyIndexOutline == "NONE" then partyIndexOutline = "" end + DF:SafeSetFont(frame.partyIndexText, partyIndexFont, partyIndexFontSize, partyIndexOutline) + end end function DF:RefreshAllFonts() @@ -1858,4 +1897,4 @@ function DF:RefreshAllFonts() end end end -end \ No newline at end of file +end diff --git a/Options/AutoProfiles.lua b/Options/AutoProfiles.lua index 4b6cea8..a0f6bca 100644 --- a/Options/AutoProfiles.lua +++ b/Options/AutoProfiles.lua @@ -140,6 +140,7 @@ local OVERRIDE_TAB_MAP = { -- Text {"statusText", "text_status", "Status Text"}, {"name", "text_name", "Name Text"}, + {"partyIndexText", "text_party_index", "Party Number Text"}, -- Auras (specific before generic) -- myBuffIndicator removed — feature deprecated and hidden from UI {"bossDebuff", "auras_bossdebuffs", "Boss Debuffs"}, diff --git a/Options/Options.lua b/Options/Options.lua index a8a1b0c..099dab6 100644 --- a/Options/Options.lua +++ b/Options/Options.lua @@ -1465,6 +1465,7 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage) db.nameFont = font; db.nameTextOutline = outline db.healthFont = font; db.healthTextOutline = outline db.statusTextFont = font; db.statusTextOutline = outline + db.partyIndexTextFont = font; db.partyIndexTextOutline = outline db.buffStackFont = font; db.buffStackOutline = outline db.buffDurationFont = font; db.buffDurationOutline = outline db.debuffStackFont = font; db.debuffStackOutline = outline @@ -1548,7 +1549,7 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage) -- ===== AFFECTED ELEMENTS GROUP (Column 2) ===== local infoGroup = GUI:CreateSettingsGroup(self.child, 280) infoGroup:AddWidget(GUI:CreateHeader(self.child, "Affected Elements"), 40) - infoGroup:AddWidget(GUI:CreateLabel(self.child, "• Name Text\n• Health Text\n• Status Text (Dead/Offline)\n• Buff Stack & Duration\n• Debuff Stack & Duration\n• Pet Frame Text\n• Targeted Spell Duration\n• Defensive Icon Duration\n• Status Icon Text (Res, Summon, etc.)\n• Group Labels (Raid)", 250), 175) + infoGroup:AddWidget(GUI:CreateLabel(self.child, "• Name Text\n• Health Text\n• Status Text (Dead/Offline)\n• Party Number Text\n• Buff Stack & Duration\n• Debuff Stack & Duration\n• Pet Frame Text\n• Targeted Spell Duration\n• Defensive Icon Duration\n• Status Icon Text (Res, Summon, etc.)\n• Group Labels (Raid)", 250), 190) infoGroup:AddWidget(GUI:CreateLabel(self.child, "Note: Font sizes are not changed. Adjust sizes in each element's page.", 250), 40) Add(infoGroup, nil, 2) end) @@ -3763,6 +3764,56 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage) truncDropdown.disableOn = function(d) return (d.nameTextLength or 0) == 0 end Add(truncGroup, nil, 2) end) + + -- Text > Party Number Text + local pagePartyIndexText = CreateSubTab("text", "text_party_index", "Party Number Text") + BuildPage(pagePartyIndexText, function(self, db, Add, AddSpace, AddSyncPoint) + Add(CreateCopyButton(self.child, {"partyIndexText"}, "Party Number Text", "text_party_index"), 25, 2) + + local settingsGroup = GUI:CreateSettingsGroup(self.child, 280) + settingsGroup:AddWidget(GUI:CreateHeader(self.child, "Party Number Text"), 40) + settingsGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Party Number Text", db, "partyIndexTextEnabled", function() + DF:RefreshAllVisibleFrames() + if DF.UpdateAllFrameAppearances then DF:UpdateAllFrameAppearances() end + end), 30) + settingsGroup:AddWidget(GUI:CreateCheckbox(self.child, "Player Always 5 (Party)", db, "partyIndexTextPlayerAtBottom", function() + DF:RefreshAllVisibleFrames() + if DF.UpdateAllFrameAppearances then DF:UpdateAllFrameAppearances() end + end), 30) + Add(settingsGroup, nil, 1) + + local positionGroup = GUI:CreateSettingsGroup(self.child, 280) + positionGroup:AddWidget(GUI:CreateHeader(self.child, "Position"), 40) + + local anchorOptions = { + CENTER = "Center", TOP = "Top", BOTTOM = "Bottom", LEFT = "Left", RIGHT = "Right", + TOPLEFT = "Top Left", TOPRIGHT = "Top Right", BOTTOMLEFT = "Bottom Left", BOTTOMRIGHT = "Bottom Right", + } + positionGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor", anchorOptions, db, "partyIndexTextAnchor", function() DF:UpdateAllFrames() end), 55) + positionGroup:AddWidget(GUI:CreateSlider(self.child, "Offset X", -50, 50, 1, db, "partyIndexTextX", nil, function() DF:LightweightUpdateTextPosition("partyIndex") end, true), 55) + positionGroup:AddWidget(GUI:CreateSlider(self.child, "Offset Y", -50, 50, 1, db, "partyIndexTextY", nil, function() DF:LightweightUpdateTextPosition("partyIndex") end, true), 55) + Add(positionGroup, nil, 2) + + local fontGroup = GUI:CreateSettingsGroup(self.child, 280) + fontGroup:AddWidget(GUI:CreateHeader(self.child, "Font"), 40) + fontGroup:AddWidget(GUI:CreateFontDropdown(self.child, "Font", db, "partyIndexTextFont", function() DF:UpdateAllFrames() end), 55) + fontGroup:AddWidget(GUI:CreateSlider(self.child, "Font Size", 6, 24, 1, db, "partyIndexTextFontSize", nil, function() DF:LightweightUpdateFontSize("partyIndex") end, true), 55) + + local outlineOptions = { NONE = "None", OUTLINE = "Outline", THICKOUTLINE = "Thick Outline", SHADOW = "Shadow" } + fontGroup:AddWidget(GUI:CreateDropdown(self.child, "Outline", outlineOptions, db, "partyIndexTextOutline", function() DF:LightweightUpdateFontSize("partyIndex") end), 55) + Add(fontGroup, nil, 1) + + local colorGroup = GUI:CreateSettingsGroup(self.child, 280) + colorGroup:AddWidget(GUI:CreateHeader(self.child, "Color"), 40) + colorGroup:AddWidget(GUI:CreateCheckbox(self.child, "Use Class Color", db, "partyIndexTextUseClassColor", function() + self:RefreshStates() + DF:RefreshAllVisibleFrames() + if DF.UpdateAllFrameAppearances then DF:UpdateAllFrameAppearances() end + end), 30) + local partyIndexColor = colorGroup:AddWidget(GUI:CreateColorPicker(self.child, "Text Color", db, "partyIndexTextColor", true, nil, function() DF:LightweightUpdateTextColor("partyIndex") end, true), 35) + partyIndexColor.disableOn = function(d) return d.partyIndexTextUseClassColor end + Add(colorGroup, nil, 2) + end) -- ======================================== -- CATEGORY: Auras diff --git a/TestMode/TestMode.lua b/TestMode/TestMode.lua index 01c2555..5a151a3 100644 --- a/TestMode/TestMode.lua +++ b/TestMode/TestMode.lua @@ -625,6 +625,21 @@ function DF:UpdateTestFrame(frame, index, applyLayout) end end frame.nameText:SetText(displayName) + + if frame.partyIndexText then + local displayIndex = DF.GetUnitPartyIndex and DF:GetUnitPartyIndex(frame.unit, db) or nil + if (not displayIndex) and type(index) == "number" then + displayIndex = (index == 0) and 1 or index + end + + if db.partyIndexTextEnabled ~= false and displayIndex then + frame.partyIndexText:SetText(tostring(displayIndex)) + frame.partyIndexText:Show() + else + frame.partyIndexText:SetText("") + frame.partyIndexText:Hide() + end + end -- Determine if this frame should show out-of-range effects -- OOR takes priority over dead fade (they should never multiply) @@ -739,6 +754,18 @@ function DF:UpdateTestFrame(frame, index, applyLayout) local c = db.nameTextColor or {r=1, g=1, b=1} frame.nameText:SetTextColor(c.r, c.g, c.b, finalNameAlpha) end + + if frame.partyIndexText and frame.partyIndexText:IsShown() then + if db.partyIndexTextUseClassColor then + local classColor = DF:GetClassColor(testData.class) + if classColor then + frame.partyIndexText:SetTextColor(classColor.r, classColor.g, classColor.b, finalNameAlpha) + end + else + local c = db.partyIndexTextColor or {r=1, g=1, b=1} + frame.partyIndexText:SetTextColor(c.r, c.g, c.b, finalNameAlpha) + end + end -- Update health bar color based on mode -- Use RGB only (no alpha in SetStatusBarColor) so we can control alpha externally From db74b6c91ab36a07ee8494a0e4ef50234f9a816e Mon Sep 17 00:00:00 2001 From: Mitchell Monaghan Date: Wed, 11 Mar 2026 18:23:02 -0500 Subject: [PATCH 2/2] Updated player to be the party size ex 3, instead of always 5 --- Frames/Core.lua | 4 ++-- Options/Options.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Frames/Core.lua b/Frames/Core.lua index 4566786..e8db646 100644 --- a/Frames/Core.lua +++ b/Frames/Core.lua @@ -515,7 +515,7 @@ end -- Get the displayed party/raid index for a unit token. -- Party mode default: player=1, party1=2 ... party4=5 --- Optional remap mode: party1=1 ... party4=4, player=5 +-- Optional remap mode: party1=1 ... party4=4, player=party size -- Raid mode: raid1 ... raid40 function DF:GetUnitPartyIndex(unit, db) if not unit or unit == "" then return nil end @@ -540,7 +540,7 @@ function DF:GetUnitPartyIndex(unit, db) if UnitIsUnit(unit, "player") then if db and db.partyIndexTextPlayerAtBottom then - return 5 + return (GetNumSubgroupMembers() or 0) + 1 end return 1 end diff --git a/Options/Options.lua b/Options/Options.lua index 099dab6..610cd56 100644 --- a/Options/Options.lua +++ b/Options/Options.lua @@ -3776,7 +3776,7 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage) DF:RefreshAllVisibleFrames() if DF.UpdateAllFrameAppearances then DF:UpdateAllFrameAppearances() end end), 30) - settingsGroup:AddWidget(GUI:CreateCheckbox(self.child, "Player Always 5 (Party)", db, "partyIndexTextPlayerAtBottom", function() + settingsGroup:AddWidget(GUI:CreateCheckbox(self.child, "Player Labeled As Party Size", db, "partyIndexTextPlayerAtBottom", function() DF:RefreshAllVisibleFrames() if DF.UpdateAllFrameAppearances then DF:UpdateAllFrameAppearances() end end), 30)