From 61b67812a0a61b70a78e106beb3fda560a41301c Mon Sep 17 00:00:00 2001 From: Krathe Date: Tue, 16 Jun 2026 03:28:39 +0100 Subject: [PATCH 1/4] OOR text alpha: drive the Text Designer overlay (unified Text Alpha) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Text Designer now renders all unit text, so the legacy per-element OOR text alphas (oorNameTextAlpha / oorHealthTextAlpha) acted on the now-hidden legacy FontStrings and did nothing — the reported 'Name Text Alpha doesn't work since the last update'. Rework it to a single unified 'Text Alpha' that dims the whole TD overlay out of range: - Render.lua: at the end of Render:UpdateFrame, fade frame._tdOverlay via SetAlphaFromBoolean(dfInRange, 1, oorTextAlpha) when oorEnabled (secret-safe; dfInRange may be a secret boolean). oorEnabled off -> overlay stays 1 and the frame-level OOR fade cascades to it as a child. - Config: new oorTextAlpha (party + raid), default 0.55. - Options: replace the Name/Health Text Alpha sliders with one 'Text Alpha'. - ExportCategories: export oorTextAlpha. - Core/Profile: MigrateOORTextAlpha folds a customised legacy oorNameTextAlpha (changed from its old default of 1) into oorTextAlpha, per-profile guarded. Legacy keys left in place (harmless). Test-mode TD OOR preview is unchanged (separate testData path). --- Config.lua | 2 ++ Core.lua | 25 +++++++++++++++++++++++++ ExportCategories.lua | 1 + Locales/enUS.lua | 1 + Options/Options.lua | 12 ++++++------ Profile.lua | 3 +++ TextDesigner/Render.lua | 25 +++++++++++++++++++++++++ 7 files changed, 63 insertions(+), 6 deletions(-) diff --git a/Config.lua b/Config.lua index daf8d3cb..00692d24 100644 --- a/Config.lua +++ b/Config.lua @@ -1660,6 +1660,7 @@ DF.PartyDefaults = { oorMissingHealthAlpha = 0.20000000298023, oorMyBuffIndicatorAlpha = 0, oorNameTextAlpha = 1, + oorTextAlpha = 0.55, -- unified OOR alpha for ALL Text Designer text (replaces the per-element name/health text alphas, which are legacy) oorPowerBarAlpha = 0.20000000298023, oorTargetedSpellAlpha = 0.5, oorAuraDesignerAlpha = 0.20000000298023, @@ -3260,6 +3261,7 @@ DF.RaidDefaults = { oorMissingHealthAlpha = 0.20000000298023, oorMyBuffIndicatorAlpha = 0, oorNameTextAlpha = 1, + oorTextAlpha = 0.55, -- unified OOR alpha for ALL Text Designer text (replaces the per-element name/health text alphas, which are legacy) oorPowerBarAlpha = 0.20000000298023, oorTargetedSpellAlpha = 0.5, oorAuraDesignerAlpha = 0.20000000298023, diff --git a/Core.lua b/Core.lua index a4b49abc..66974520 100644 --- a/Core.lua +++ b/Core.lua @@ -3509,6 +3509,25 @@ local function ZeroBuffDebuffBorderInset(profile) end end +-- Fold the legacy per-element OOR name-text alpha into the unified oorTextAlpha. +-- The Text Designer now renders all unit text, so a single OOR "Text Alpha" dims +-- every TD element out of range. Carry the user's old name-text value only when +-- they changed it from the prior default (1); default-config users get the new +-- oorTextAlpha default instead. Per-profile guarded so later oorTextAlpha edits stick. +function DF:MigrateOORTextAlpha() + if not DandersFramesDB_v2 or not DandersFramesDB_v2.profiles then return end + for _, profile in pairs(DandersFramesDB_v2.profiles) do + if type(profile) == "table" and not profile._oorTextAlphaV1 then + for _, modeKey in ipairs({ "party", "raid" }) do + local m = profile[modeKey] + if type(m) == "table" and m.oorNameTextAlpha ~= nil and m.oorNameTextAlpha ~= 1 then + m.oorTextAlpha = m.oorNameTextAlpha + end + end + profile._oorTextAlphaV1 = true + end + end +end -- One-shot per-profile, two independently-guarded steps so a profile already -- through step 1 still receives step 2. Both steps are value-idempotent. function DF:MigrateBorderInsetFold() @@ -5304,6 +5323,12 @@ DF._MainEventDispatcher = function(self, event, arg1) DF:MigrateBorderInsetFold() end + -- Fold the legacy OOR name-text alpha into the unified oorTextAlpha + -- (Text Designer now renders all text). Per-profile guarded. + if DF.MigrateOORTextAlpha then + DF:MigrateOORTextAlpha() + end + -- CRITICAL: Update power bars now that unit data is available -- At ADDON_LOADED, UnitPower() etc may return 0 before player is loaded -- Power bar updates don't require combat protection diff --git a/ExportCategories.lua b/ExportCategories.lua index bcd5b34f..5ba673fc 100644 --- a/ExportCategories.lua +++ b/ExportCategories.lua @@ -1108,6 +1108,7 @@ DF.ExportCategories = { "oorPowerBarAlpha", "oorAurasAlpha", "oorNameTextAlpha", + "oorTextAlpha", "oorIconsAlpha", "oorDispelOverlayAlpha", "oorDefensiveIconAlpha", diff --git a/Locales/enUS.lua b/Locales/enUS.lua index 577203a8..bc0f62d8 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -1064,6 +1064,7 @@ L["Name Anchor"] = true L["Name Color"] = true L["Name Text"] = true L["Name Text Alpha"] = true +L["Text Alpha"] = true L["Name X Offset"] = true L["Name Y Offset"] = true L["Newest First"] = true diff --git a/Options/Options.lua b/Options/Options.lua index af85f6cb..0913004c 100644 --- a/Options/Options.lua +++ b/Options/Options.lua @@ -772,12 +772,12 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage) local oorBorder = oorGroup:AddWidget(GUI:CreateSlider(self.child, L["Border Alpha"], 0.0, 1.0, 0.05, db, "oorBorderAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55) oorBorder.hideOn = HideOOROptions - local oorName = oorGroup:AddWidget(GUI:CreateSlider(self.child, L["Name Text Alpha"], 0.0, 1.0, 0.05, db, "oorNameTextAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55) - oorName.hideOn = HideOOROptions - - local oorHealthText = oorGroup:AddWidget(GUI:CreateSlider(self.child, L["Health Text Alpha"], 0.0, 1.0, 0.05, db, "oorHealthTextAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55) - oorHealthText.hideOn = HideOOROptions - + -- Unified Text Alpha: the Text Designer now renders all unit text, so a + -- single OOR alpha dims every TD text element (name/health/power/custom) + -- out of range — replacing the old per-element Name/Health text alphas. + local oorText = oorGroup:AddWidget(GUI:CreateSlider(self.child, L["Text Alpha"], 0.0, 1.0, 0.05, db, "oorTextAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55) + oorText.hideOn = HideOOROptions + local oorAuras = oorGroup:AddWidget(GUI:CreateSlider(self.child, L["Auras Alpha"], 0.0, 1.0, 0.05, db, "oorAurasAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55) oorAuras.hideOn = HideOOROptions diff --git a/Profile.lua b/Profile.lua index 634532d2..95d7f497 100644 --- a/Profile.lua +++ b/Profile.lua @@ -306,6 +306,9 @@ function DF:SetProfile(name) if DF.MigrateBorderInsetFold then DF:MigrateBorderInsetFold() end + if DF.MigrateOORTextAlpha then + DF:MigrateOORTextAlpha() + end -- Apply the profile — runtime state is already clear so the proxy reads -- the new profile directly with no stale overlay diff --git a/TextDesigner/Render.lua b/TextDesigner/Render.lua index 3ec0417e..b4f8f7e3 100644 --- a/TextDesigner/Render.lua +++ b/TextDesigner/Render.lua @@ -276,6 +276,31 @@ function Render:UpdateFrame(frame, tdDB, source, hint, isPreview) end end end + + -- Out-of-range fade (element-specific OOR mode). TD now owns the unit's + -- text, so the unified OOR "Text Alpha" dims the whole TD overlay — every + -- element at once — while the unit is out of range. SetAlphaFromBoolean is + -- secret-safe (dfInRange may be a secret boolean on non-healer specs in + -- Midnight). When oorEnabled is off, the frame-level OOR fade cascades to + -- the overlay as a child, so leave it at full alpha here. + if not isPreview and frame.unit and frame._tdOverlay then + local fdb = DF:GetFrameDB(frame) + local ov = frame._tdOverlay + if fdb and fdb.oorEnabled then + local inRange = frame.dfInRange + if not (issecretvalue and issecretvalue(inRange)) and inRange == nil then + inRange = true + end + local oorAlpha = fdb.oorTextAlpha or 0.55 + if ov.SetAlphaFromBoolean then + ov:SetAlphaFromBoolean(inRange, 1, oorAlpha) + else + ov:SetAlpha(inRange and 1 or oorAlpha) + end + else + ov:SetAlpha(1) + end + end end -- Tears down all FontStrings on a frame (mode switch, profile change). From ad025f65ddfa61a90c3e6b8b9c694abbb6aee133 Mon Sep 17 00:00:00 2001 From: Krathe Date: Tue, 16 Jun 2026 03:32:10 +0100 Subject: [PATCH 2/4] OOR text alpha: apply the TD overlay fade in test mode too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let test frames (dfIsTestFrame) through the OOR overlay-fade block. TestMode already sets frame.dfInRange from the test OOR state (gated on testShowOutOfRange), so the same secret-safe SetAlphaFromBoolean path now dims the TD overlay in the test preview, matching live. The Options mock preview (isPreview, not a test frame) stays skipped — it has no range state. --- TextDesigner/Render.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TextDesigner/Render.lua b/TextDesigner/Render.lua index b4f8f7e3..6fe132f3 100644 --- a/TextDesigner/Render.lua +++ b/TextDesigner/Render.lua @@ -282,8 +282,11 @@ function Render:UpdateFrame(frame, tdDB, source, hint, isPreview) -- element at once — while the unit is out of range. SetAlphaFromBoolean is -- secret-safe (dfInRange may be a secret boolean on non-healer specs in -- Midnight). When oorEnabled is off, the frame-level OOR fade cascades to - -- the overlay as a child, so leave it at full alpha here. - if not isPreview and frame.unit and frame._tdOverlay then + -- the overlay as a child, so leave it at full alpha here. Test frames are + -- included (dfIsTestFrame): TestMode sets frame.dfInRange from the test OOR + -- state, so the preview shows the same fade. The Options mock preview + -- (isPreview but not a test frame) is skipped — it has no range state. + if (not isPreview or frame.dfIsTestFrame) and frame.unit and frame._tdOverlay then local fdb = DF:GetFrameDB(frame) local ov = frame._tdOverlay if fdb and fdb.oorEnabled then From 6ba34e324f8b9b37b9c88ce0bdedc7db93144109 Mon Sep 17 00:00:00 2001 From: Krathe Date: Tue, 16 Jun 2026 21:20:20 +0100 Subject: [PATCH 3/4] Changelog: add #163 entry to CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a275570c..39ab2804 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ ### Improvements * (Pinned Frames) Pinned frame settings are now **global per party/raid mode** and no longer saved into auto layouts — a raid auto layout only controls whether each pinned set is **shown** for that layout. This removes the stale/blank pinned data and editor mismatches that came from pinned settings being stored per-layout, and pinned edits now take effect live. (by Krathe) +* (Out of Range) The out-of-range text fade is now a single **Text Alpha** control that dims the whole Text Designer overlay together, replacing the old per-element Name/Health alpha sliders that no longer did anything once the Text Designer took over text rendering. (by Krathe) ### Bug Fixes From 5f6d8450c0ef07ca699989f827280273b48e2c41 Mon Sep 17 00:00:00 2001 From: Krathe Date: Tue, 16 Jun 2026 23:59:36 +0100 Subject: [PATCH 4/4] Locale: move Text Alpha to its alphabetical slot --- Locales/enUS.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Locales/enUS.lua b/Locales/enUS.lua index bc0f62d8..824c1a8e 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -1064,7 +1064,6 @@ L["Name Anchor"] = true L["Name Color"] = true L["Name Text"] = true L["Name Text Alpha"] = true -L["Text Alpha"] = true L["Name X Offset"] = true L["Name Y Offset"] = true L["Newest First"] = true @@ -1492,6 +1491,7 @@ L["Test mode disabled."] = true L["Test mode enabled."] = true L["Test mode ended — entering combat."] = true L["Text"] = true +L["Text Alpha"] = true L["Text Color"] = true L["Text Colors:"] = true L["Text Designer"] = true