Skip to content

feat(powerbars): add Boss Health Marker spark to UnitFrames and ResourceBars - #1932

Open
kylelemons wants to merge 1 commit into
EllesmereGaming:mainfrom
kylelemons:feat/powerbar-boss-health-marker
Open

kylelemons wants to merge 1 commit into
EllesmereGaming:mainfrom
kylelemons:feat/powerbar-boss-health-marker

Conversation

@kylelemons

@kylelemons kylelemons commented Sep 3, 2026 •

Copy link
Copy Markdown

What does this PR do?

Adds an opt-in Boss Health Marker toggle (bossPacingEnabled) to the Player Power Bar in both Unit Frames (Unit Frames > Main Frames > Power Bar) and Resource Bars (Resource Bars > Primary Bar).

During boss encounters, this renders a subtle 2px vertical sparkline on the player's power bar that aligns with boss1 current health percentage, assisting healers and DPS with resource and mana pacing against boss phases.

Key highlights:

  • Zero Cost / Opt-In: Setting defaults to false across both modules.
  • Strict Lazy Event Handling: Event frames (UNIT_HEALTH, UNIT_MAXHEALTH for boss1, INSTANCE_ENCOUNTER_ENGAGE_UNIT, PLAYER_REGEN_DISABLED/ENABLED) are only registered when bossPacingEnabled == true.
  • Zero Taint / Secret Value Safe: The sparkline is parented to a 0-alpha StatusBar tracking UnitHealth("boss1"), using native UI frame alignment without running Lua math on protected combat values.
  • Live Settings Preview: In EUI_UnitFrames_Options.lua, toggling the checkbox renders a live sparkline preview directly on the unit frame preview bar at the top of the settings page.
  • Clean 2-Slot Layout: Paired cleanly with the specialization-dependent Power Type override in a unified DualRow with zero layout shift or vertical gutters.
  • Local Chunk Compliance: Wrapped in a scoped do ... end block to respect Lua 5.1's 200 local variable limit.

How was it tested?

  • Tested on retail client build 12.1.0.69587.
  • Verified toggle defaults to OFF and produces 0 overhead when disabled.
  • Tested during boss encounters in raid/dungeon; confirmed spark tracks boss health smoothly and hides outside of boss encounters.
  • Tested live settings preview in UnitFrames options pane.

Screenshots

Type Setting Live
Unitframe boss_pacing_unit_setting boss_pacing_unit_live
Resource Bar boss_pacing_bar_setting boss_pacing_bar_live

Checklist

  • New settings default OFF (no behavior change without opt-in)
  • Zero cost while disabled: no events registered, no polling, no hooks doing work, no frames built
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations)
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames
  • Tested in-game on live; no version gates or pre-Midnight APIs added

@kylelemons
kylelemons force-pushed the feat/powerbar-boss-health-marker branch 2 times, most recently from 60576d2 to 86a84da Compare September 11, 2026 00:30
@kylelemons
kylelemons force-pushed the feat/powerbar-boss-health-marker branch from 86a84da to f137965 Compare September 22, 2026 00:46
@kylelemons
kylelemons force-pushed the feat/powerbar-boss-health-marker branch from f137965 to 7e2f810 Compare September 30, 2026 00:35
…rceBars

Add an opt-in Boss Health Marker sparkline to the player power bar in both UnitFrames and ResourceBars to assist with mana pacing against boss health during encounters.

- Defaults to OFF (bossPacingEnabled = false)
- Zero cost when disabled: event frame only registers when enabled and boss exists
- Zero taint risk: uses StatusBar SetValue with boss1 health, no Lua math on protected values
- Includes live visual preview on the UnitFrames preview frame in settings
- Clean 2-slot options row pairing with spec-dependent power type
@kylelemons
kylelemons force-pushed the feat/powerbar-boss-health-marker branch from 7e2f810 to cb97600 Compare October 10, 2026 00:16
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