Skip to content

Feat/class color background#367

Open
Trenchfoote wants to merge 2 commits into
EllesmereGaming:mainfrom
Trenchfoote:feat/class-color-background
Open

Feat/class color background#367
Trenchfoote wants to merge 2 commits into
EllesmereGaming:mainfrom
Trenchfoote:feat/class-color-background

Conversation

@Trenchfoote

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 7, 2026 05:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a class-colored background option for unit/raid health bars, updates theme and preview logic to respect it, and improves range-alpha behavior in options.

Changes:

  • Added bgClassColored setting defaults for unit frames and raid frames.
  • Updated health bar background rendering (live + preview) to optionally use class color for the background.
  • Fixed raid-frame OOR alpha to respect party-specific scaling and made the OOR alpha slider apply immediately.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
EllesmereUIUnitFrames/EllesmereUIUnitFrames.lua Adds bgClassColored defaults and applies class-colored background logic in dark theme updates.
EllesmereUIUnitFrames/EUI_UnitFrames_Options.lua Extends options UI/preview to toggle class-colored background and sync settings across units.
EllesmereUIRaidFrames/EllesmereUIRaidFrames.lua Adds bgClassColored defaults, introduces ns.GetBgColor, updates background anchoring and OOR alpha source.
EllesmereUIRaidFrames/EUI_RaidFrames_Options.lua Adds UI toggles for class-colored background and makes OOR alpha slider reapply immediately.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1120 to +1125
local u = unit or self.unit or uKey
if u then
local _, ct = UnitClass(u)
local cc = ct and EllesmereUI.GetClassColor(ct)
if cc then bgClassR, bgClassG, bgClassB = cc.r, cc.g, cc.b end
end
Comment on lines +1152 to +1157
local u = unitKey or (health.__owner and health.__owner.unit)
if u then
local _, ct = UnitClass(u)
local cc = ct and EllesmereUI.GetClassColor(ct)
if cc then bgClassR, bgClassG, bgClassB = cc.r, cc.g, cc.b end
end
Comment on lines +4498 to +4506
bgSw._eabOrigClick = bgSw:GetScript("OnClick")
bgSw:SetScript("OnClick", function(self)
if SVal("bgClassColored", false) then
SSet("bgClassColored", false)
ReloadAndUpdate(); UpdatePreview(); EllesmereUI:RefreshPage()
return
end
if self._eabOrigClick then self._eabOrigClick(self) end
end)
Comment on lines +4465 to +4467
SSet("bgClassColored", true)
ReloadAndUpdate(); UpdatePreview(); EllesmereUI:RefreshPage()
end)
Comment on lines +629 to +637
bgSwatch._eabOrigClick = bgSwatch:GetScript("OnClick")
bgSwatch:SetScript("OnClick", function(self)
if SVal("bgClassColored", false) then
SSet("bgClassColored", false)
ReloadAndUpdate(); EllesmereUI:RefreshPage()
return
end
if self._eabOrigClick then self._eabOrigClick(self) end
end)
Adds a class-color option for the health bar *background*, mirroring the
existing class-color option for the health bar fill. A Custom/Class swatch
pair on the Background control toggles bgClassColored; clicking either dims
the inactive one (same pattern as the fill picker).

- New GetBgColor(unit, s) resolves the bg to the unit's class color when
  bgClassColored is set, else the custom bg color, at bgDarkness alpha. The
  class path is secret-safe (guards a secret classToken from out-of-range/
  uninspectable units before the GetClassColor table index).
- Applied in live frames, ReloadFrames, and both config previews.
- Depends on the missing-health-portion bg anchoring; with class colors the
  bg now reveals as health drops (instead of a full bright backing that
  would bleed through the fill).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Trenchfoote Trenchfoote force-pushed the feat/class-color-background branch from d8da645 to 4f6e0f8 Compare June 7, 2026 18:25
Out-of-range/uninspectable units can return a secret class token from UnitClass; mirror the RaidFrames guard so GetClassColor is only called on a real token. Addresses Copilot review on the class-color bg picker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Trenchfoote Trenchfoote force-pushed the feat/class-color-background branch from 95b2260 to 511beeb Compare June 7, 2026 19:17
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