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 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..824c1a8e 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -1491,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 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..6fe132f3 100644 --- a/TextDesigner/Render.lua +++ b/TextDesigner/Render.lua @@ -276,6 +276,34 @@ 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. 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 + 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).