Skip to content

Fix BUG Unitframes: detached power bar layering + power bar border#373

Open
Aderfi wants to merge 1 commit into
EllesmereGaming:mainfrom
Aderfi:fix/detached-powerbar-strata-and-border
Open

Fix BUG Unitframes: detached power bar layering + power bar border#373
Aderfi wants to merge 1 commit into
EllesmereGaming:mainfrom
Aderfi:fix/detached-powerbar-strata-and-border

Conversation

@Aderfi

@Aderfi Aderfi commented Jun 8, 2026

Copy link
Copy Markdown

The bug

Two related issues with the detached power bar on unit frames (player / target / focus / etc.):

  1. The health bar's border bleeds through the power bar. When the detached power bar is positioned over the edge of the health bar, the unit frame's unified border renders on top of (i.e. through) the power bar instead of behind it.
  2. Adding a border to the power bar doesn't work. Picking a border style/size for the detached power bar has no visible effect.

Cause

  • The unified frame border lives at frame level +10. CreatePowerBar intentionally placed a detached power bar at frame level +12 (above the border), but ReparentBarsToClip later clobbered that, forcing every power bar down to health level +2 (= frame level +4). That left the detached bar and its border below the health border, so the border showed through.
  • The power bar's border frame (_pbBorder) was only created at spawn time, and only when the bar was already detached. Switching a bar to detached at runtime goes through the in-place reload path, which only updated an existing border (if frame.Power._pbBorder then ...) and never created one — so the border options did nothing.

The fix

  • ReparentBarsToClip now keeps a detached power bar at frame level +12 (above the unified border), while attached bars keep the health level +2 behaviour needed to sit above the absorb overlay.
  • Border handling is centralized in a single ApplyPowerBarBorder helper that lazily creates the border frame (so a live attached → detached switch picks it up) and always re-derives the border's frame level from the bar's current level. It's called from CreatePowerBar, from ReparentBarsToClip (after the level is re-asserted, so textured borders track the bar too), and from the reload paths.
  • Removed the duplicated inline power-border blocks in the player/target reload branches in favour of the helper. As a side benefit, focus/pet/boss detached bars now also refresh their border on reload. Net change is fewer lines.

Testing

Tested in-game: the health border no longer shows through the detached power bar, and selecting a border style/size for the power bar now applies correctly, including when switching a bar to detached without a /reload.

…lth border

When the power bar is detached and positioned over the health bar edge, the
unit frame's unified border (frame level +10) rendered on top of the power bar
because ReparentBarsToClip forced the detached bar down to health level +2.
The bar now stays at frame level +12 so the health border no longer shows
through it.

Also fixes the power bar border never appearing when switching a bar to
detached at runtime: the border frame was only created at spawn time for
already-detached bars. Border creation is now centralized in a single
ApplyPowerBarBorder helper that lazily creates the frame and re-derives its
level from the bar, called from CreatePowerBar, ReparentBarsToClip and the
reload paths (removing the duplicated inline blocks).
@Aderfi Aderfi changed the title fix(unitframes): detached power bar layering + power bar border Fix BUG Unitframes: detached power bar layering + power bar border Jun 8, 2026
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.

1 participant