diff --git a/AuraDesigner/Indicators.lua b/AuraDesigner/Indicators.lua index 95d10024..1802ab68 100644 --- a/AuraDesigner/Indicators.lua +++ b/AuraDesigner/Indicators.lua @@ -1033,12 +1033,29 @@ function Indicators:ApplyHealthBar(frame, config, auraData) local r, g, b = color[1] or color.r or 1, color[2] or color.g or 1, color[3] or color.b or 1 local mode = string.lower(config.mode or "replace") - -- Both modes use the overlay — replace forces full opacity, tint uses blend slider + -- Replace: full opacity overlay; Tint: blend slider controls mix strength local blend = (mode == "replace") and 1 or (config.blend or 0.5) + -- Store on state so UpdateAuraDesignerAppearance can access these for OOR handling + state.healthbarMode = mode + state.healthbarR = r + state.healthbarG = g + state.healthbarB = b + state.healthbarBlend = blend + local overlay = GetOrCreateTintOverlay(frame) if overlay then overlay:SetStatusBarColor(r, g, b, blend) + -- In replace mode, also colour the underlying health bar texture to match the overlay. + -- This prevents class-colour bleedthrough when the overlay fades OOR. In tint mode the + -- underlying bar colour is intentionally visible through the semi-transparent overlay, + -- so we leave it at its normal colour. + if mode == "replace" then + local hbTex = healthBar:GetStatusBarTexture() + if hbTex then + hbTex:SetVertexColor(r, g, b) + end + end -- Snap fill to current health before showing so the bar doesn't animate -- from near-empty to the correct position (ExponentialEaseOut + the -- min/max changing from the creation default of 0-1 to 0-maxHealth diff --git a/Features/ElementAppearance.lua b/Features/ElementAppearance.lua index 633305f3..ad3c29f2 100644 --- a/Features/ElementAppearance.lua +++ b/Features/ElementAppearance.lua @@ -1089,6 +1089,27 @@ function DF:UpdateAuraDesignerAppearance(frame) end end end + -- Tint overlay (health bar "show when missing" indicator) + -- Control opacity via SetStatusBarColor rather than SetAlpha. + -- SetAlpha compounds with the blend baked into SetStatusBarColor: + -- blend × oorAlpha = e.g. 0.5 × 0.2 = 0.1 (nearly invisible OOR). + -- Setting SetStatusBarColor directly gives the exact target opacity. + local tintOverlay = frame.dfAD and frame.dfAD.tintOverlay + if tintOverlay and tintOverlay:IsShown() then + local adState = frame.dfAD + local r, g, b = adState.healthbarR or 1, adState.healthbarG or 1, adState.healthbarB or 1 + local blend = adState.healthbarBlend or 0.5 + + if issecretvalue and issecretvalue(inRange) then + -- Secret boolean fallback — can't branch; leave at configured blend. + tintOverlay:SetStatusBarColor(r, g, b, blend) + elseif inRange then + tintOverlay:SetStatusBarColor(r, g, b, blend) + else + tintOverlay:SetStatusBarColor(r, g, b, oorAlpha) + end + tintOverlay:SetAlpha(1.0) + end else -- Frame-level mode: restore each indicator's base alpha if frame.dfAD_icons then @@ -1106,6 +1127,17 @@ function DF:UpdateAuraDesignerAppearance(frame) if bar then bar:SetAlpha(bar.dfBaseAlpha or 1.0) end end end + -- Tint overlay (health bar "show when missing" indicator) + -- Frame-level mode: the frame cascade handles OOR alpha. Restore the overlay's + -- own alpha and SetStatusBarColor to their configured values. + local tintOverlay = frame.dfAD and frame.dfAD.tintOverlay + if tintOverlay and tintOverlay:IsShown() then + local adState = frame.dfAD + local r, g, b = adState.healthbarR or 1, adState.healthbarG or 1, adState.healthbarB or 1 + local blend = adState.healthbarBlend or 0.5 + tintOverlay:SetStatusBarColor(r, g, b, blend) + tintOverlay:SetAlpha(1.0) + end end end