From a7d3b81384d71675c4c9a74ae987f80f84bb067a Mon Sep 17 00:00:00 2001 From: Krathe Date: Sat, 9 May 2026 19:00:45 +0100 Subject: [PATCH] (Aura Designer) Fix health bar tint indicator stale state and live settings update - Re-sync tint overlay StatusBarTexture on each apply in case the frame was recycled to a different unit (stale texture from previous member) - Reset overlay SetStatusBarColor(1,1,1,1) in RevertHealthBar so stale tint colour cannot bleed through on the next activation cycle - In tint mode, briefly release the AD colour lock before re-applying so UpdateHealthBarAppearance can restore the underlying bar to its normal class/custom colour; fixes mode switching not taking effect on live frames without toggling the aura - UpdateHealthBarAppearance now only skips normal colour logic in replace mode; tint mode lets class/percent/custom colour updates run normally so the underlying bar stays correct across health events and form shifts --- AuraDesigner/Indicators.lua | 25 +++++++++++++++++++++++++ Features/ElementAppearance.lua | 6 +++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/AuraDesigner/Indicators.lua b/AuraDesigner/Indicators.lua index 95d10024..481fea95 100644 --- a/AuraDesigner/Indicators.lua +++ b/AuraDesigner/Indicators.lua @@ -1038,7 +1038,31 @@ function Indicators:ApplyHealthBar(frame, config, auraData) local overlay = GetOrCreateTintOverlay(frame) if overlay then + -- Re-sync texture in case the health bar's texture changed since the overlay + -- was first created (frame recycled to a different unit can swap textures). + local currentTex = healthBar:GetStatusBarTexture() + overlay:SetStatusBarTexture(currentTex and currentTex:GetTexture() or "Interface\\Buttons\\WHITE8x8") 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 restore it to the normal class/custom colour instead. + if mode == "replace" then + local hbTex = healthBar:GetStatusBarTexture() + if hbTex then + hbTex:SetVertexColor(r, g, b) + end + else + -- Tint mode: the underlying bar must show its normal colour through the overlay. + -- A previous replace-mode apply may have left a stale AD vertex colour on hbTex. + -- Briefly release the AD lock so UpdateHealthBarAppearance restores the normal + -- class/custom colour before we re-claim the bar. + state.healthbar = false + if DF.UpdateHealthBarAppearance then + DF:UpdateHealthBarAppearance(frame) + end + state.healthbar = true + 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 @@ -1105,6 +1129,7 @@ function Indicators:RevertHealthBar(frame) state.tintOverlay:SetAlpha(1) end state.tintOverlay:Hide() + state.tintOverlay:SetStatusBarColor(1, 1, 1, 1) end -- Refresh health bar color so the bar shows the correct color diff --git a/Features/ElementAppearance.lua b/Features/ElementAppearance.lua index 633305f3..79bbb59d 100644 --- a/Features/ElementAppearance.lua +++ b/Features/ElementAppearance.lua @@ -190,9 +190,13 @@ function DF:UpdateHealthBarAppearance(frame) -- overwrite it. Alpha is still applied below so OOR/dead fade -- continues to work. -- ======================================== + -- In replace mode AD owns the bar colour entirely — skip normal colour updates. + -- In tint mode the underlying bar shows through the overlay, so normal colour + -- logic (class / percent / custom) must still run. local adHealthBarActive = frame.dfAD and frame.dfAD.healthbar + local adHealthBarMode = adHealthBarActive and frame.dfAD.healthbarMode - if adHealthBarActive then + if adHealthBarMode == "replace" then -- AD owns the color — don't touch it elseif aggroActive then -- Priority 1: Aggro override