Skip to content

Commit 7f41119

Browse files
Krathe82mergetest
authored andcommitted
Bars: apply the missing-texture fallback on every update path
The green class-colour reports are missing textures: broken profiles referenced bar textures belonging to other addons (third-party media paths carried in by imported profiles). A statusbar texture that fails to load renders solid green, so class colours appeared broken while the colour settings were verifiably correct (confirmed by decoding a reporter's export + SavedVariables: the broken profile/mode combinations were exactly the ones whose healthTexture pointed at third-party media, per-profile AND per-mode). PR #123's SafeSetStatusBarTexture fallback only ran at frame CREATION; ApplyFrameLayout re-applied db textures raw on every settings pass and immediately clobbered the stock fallback. Route every user-configurable bar texture through the safe setter: health/absorb/heal-absorb in ApplyFrameLayout, the test-mode health + missing-health previews, and the targeted-list bar. Internal constant textures (gradient LUTs, the Blizzard shield overlay) are untouched.
1 parent 0f13c1d commit 7f41119

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Bug Fixes
66

7+
* (Bars) **Fixed health bars rendering solid green when a profile references a bar texture you don't have** — imported profiles often point at another addon's texture files; if that addon isn't installed (or its files changed), the bar showed WoW's green missing-texture state and class colours appeared broken. All bar textures now fall back to the stock texture with a one-time warning, on every update path (the fallback previously only applied when a frame was first created and was immediately overwritten). (by Krathe)
78
* (Bars) Fixed class-coloured health bars staying stuck on the gradient colour (usually green) after using or switching away from the Percent colour mode — the class/custom colour is now written directly to the bar texture, so it can no longer be masked by a leftover gradient tint. (by Krathe)
89

910
## [4.7.2]

Features/TargetedSpells.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4338,7 +4338,7 @@ local function TargetedList_ApplyBarAppearance(bar, db)
43384338
-- which clobbers the progress fill set by ApplyBarContent.
43394339
local texturePath = db.targetedListTexture or "Interface\\TargetingFrame\\UI-StatusBar"
43404340
if bar._lastTexturePath ~= texturePath then
4341-
bar.progress:SetStatusBarTexture(texturePath)
4341+
DF:SafeSetStatusBarTexture(bar.progress, texturePath)
43424342
bar._lastTexturePath = texturePath
43434343
end
43444344

Frames/Update.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ function DF:ApplyFrameLayout(frame)
8181
if healthBar then
8282
-- Texture
8383
local healthTex = db.healthTexture or "Interface\\TargetingFrame\\UI-StatusBar"
84-
healthBar:SetStatusBarTexture(healthTex)
84+
-- Safe setter: falls back to the stock texture when the configured path
85+
-- is missing (imported profiles referencing another addon's media render
86+
-- solid green otherwise). Frame CREATION already used the safe setter,
87+
-- but this per-update raw call immediately clobbered its fallback.
88+
DF:SafeSetStatusBarTexture(healthBar, healthTex)
8589

8690
-- Orientation
8791
local orientation = db.healthOrientation or "HORIZONTAL"
@@ -141,7 +145,7 @@ function DF:ApplyFrameLayout(frame)
141145
local absorbTex = db.absorbBarTexture or "Interface\\Buttons\\WHITE8x8"
142146
local absorbColor = db.absorbBarColor or {r = 0, g = 0.835, b = 1, a = 0.7}
143147

144-
absorbBar:SetStatusBarTexture(absorbTex)
148+
DF:SafeSetStatusBarTexture(absorbBar, absorbTex)
145149
absorbBar:SetStatusBarColor(absorbColor.r, absorbColor.g, absorbColor.b, absorbColor.a)
146150

147151
if absorbMode == "FLOATING" then
@@ -179,7 +183,7 @@ function DF:ApplyFrameLayout(frame)
179183
local healAbsorbTex = db.healAbsorbBarTexture or "Interface\\Buttons\\WHITE8x8"
180184
local healAbsorbColor = db.healAbsorbBarColor or {r = 0.4, g = 0.1, b = 0.1, a = 0.7}
181185

182-
healAbsorbBar:SetStatusBarTexture(healAbsorbTex)
186+
DF:SafeSetStatusBarTexture(healAbsorbBar, healAbsorbTex)
183187
healAbsorbBar:SetStatusBarColor(healAbsorbColor.r, healAbsorbColor.g, healAbsorbColor.b, healAbsorbColor.a)
184188

185189
if healAbsorbMode == "FLOATING" then

TestMode/TestMode.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ function DF:UpdateTestFrameHealthOnly(frame, index)
471471
if not texture or texture == "" then
472472
texture = db.healthTexture or "Interface\\TargetingFrame\\UI-StatusBar"
473473
end
474-
frame.missingHealthBar:SetStatusBarTexture(texture)
474+
DF:SafeSetStatusBarTexture(frame.missingHealthBar, texture)
475475

476476
frame.missingHealthBar:Show()
477477
else
@@ -667,7 +667,7 @@ function DF:UpdateTestFrame(frame, index, applyLayout)
667667
if not texture or texture == "" then
668668
texture = db.healthTexture or "Interface\\TargetingFrame\\UI-StatusBar"
669669
end
670-
frame.missingHealthBar:SetStatusBarTexture(texture)
670+
DF:SafeSetStatusBarTexture(frame.missingHealthBar, texture)
671671

672672
frame.missingHealthBar:Show()
673673
else
@@ -2606,7 +2606,7 @@ function DF:ApplyTestFrameLayout(frame)
26062606
if frame.healthBar then
26072607
-- Texture
26082608
local healthTex = db.healthTexture or "Interface\\TargetingFrame\\UI-StatusBar"
2609-
frame.healthBar:SetStatusBarTexture(healthTex)
2609+
DF:SafeSetStatusBarTexture(frame.healthBar, healthTex)
26102610

26112611
-- Orientation
26122612
local orientation = db.healthOrientation or "HORIZONTAL"
@@ -2634,7 +2634,7 @@ function DF:ApplyTestFrameLayout(frame)
26342634
if not missingTex or missingTex == "" then
26352635
missingTex = healthTex
26362636
end
2637-
frame.missingHealthBar:SetStatusBarTexture(missingTex)
2637+
DF:SafeSetStatusBarTexture(frame.missingHealthBar, missingTex)
26382638

26392639
if orientation == "HORIZONTAL" then
26402640
frame.missingHealthBar:SetOrientation("HORIZONTAL")

0 commit comments

Comments
 (0)