Skip to content

fix(raidframes): honor class color in live health-bar background#412

Closed
nulltyto wants to merge 1 commit into
EllesmereGaming:mainfrom
nulltyto:bugfix/8.2.3-class-color-background
Closed

fix(raidframes): honor class color in live health-bar background#412
nulltyto wants to merge 1 commit into
EllesmereGaming:mainfrom
nulltyto:bugfix/8.2.3-class-color-background

Conversation

@nulltyto

@nulltyto nulltyto commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Problem

The class-color background option (Raid Frames → Health Bar → Background) shows correctly in the options preview but reverts to the Custom Background Color on live party/raid frames in-game (reproduced in a dungeon).

Cause

The preview and reload paths use ns.GetBgColor, which honors the bgClassColored toggle. But the live update paths — UpdateButton and _UpdateButtonHealth — both call ns._ApplyHealthBg, which hardcoded s.customBgColor and never checked bgClassColored.

Because UNIT_HEALTH fires constantly in combat, _ApplyHealthBg repaints the custom color over the class tint that the reload path had set — so the frame never holds the class color while you're actually playing.

Fix

Route the alive/online branch of _ApplyHealthBg through ns.GetBgColor(unit, s), keeping the live path in lockstep with the preview/reload paths. GetBgColor returns r,g,b,a (alpha = bgDarkness) and is secret-value safe.

Both _ApplyHealthBg call sites already pass the correctly-resolved settings proxy (ns._scaledPartyProxy for party, ns._scaledProfile for raid), so this fixes both party and raid with one change. The dark health-color mode and dead/offline status tints are untouched.

Testing

  • Lua syntax check (luac -p) passes
  • Party class color holds on live frames in a dungeon (taking damage)
  • Raid frames in a raid group
  • bgDarkness slider still affects the class-colored bg
  • Toggle OFF cleanly reverts to custom color on live frames
  • Dead/offline → resurrect restores class color
  • Dark health-color mode still uses dark bg (not class color)
  • Out-of-range / uninspectable units fall back gracefully (no Lua error)

Bug report: https://discord.com/channels/585577383847788554/1517963435776671774

The class-color background option (Raid Frames > Health Bar > Background)
worked in the preview but reverted to the custom color on live frames.

The preview and reload paths use ns.GetBgColor (which honors bgClassColored),
but the live update paths (UpdateButton, _UpdateButtonHealth) called
ns._ApplyHealthBg, which hardcoded s.customBgColor. Since UNIT_HEALTH fires
constantly in combat, _ApplyHealthBg repainted the custom color over the
class tint set at reload.

Route the alive/online branch through ns.GetBgColor so the live path stays in
lockstep with the preview/reload paths. Fixes party and raid (both call sites
already pass the correctly-resolved settings proxy).
@EllesmereGaming

Copy link
Copy Markdown
Owner

i actually already fixed this locally was about to push the patch D: sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants