Skip to content

CDM: add "Hide Empty Healthstone" option#366

Open
Trenchfoote wants to merge 1 commit into
EllesmereGaming:mainfrom
Trenchfoote:feat/cdm-hide-empty-healthstone
Open

CDM: add "Hide Empty Healthstone" option#366
Trenchfoote wants to merge 1 commit into
EllesmereGaming:mainfrom
Trenchfoote:feat/cdm-hide-empty-healthstone

Conversation

@Trenchfoote

Copy link
Copy Markdown
Contributor

Adds a per-bar toggle (CD/utility custom bars) that hides the Healthstone icon entirely when the player has none in bags, instead of showing it desaturated.

  • Gated at injection in CollectAndReanchor so the layout reflows; only applies to the healthstone/demonic_healthstone presets, counting the preset's altItemIDs too. Layout changes are combat-locked, so in combat the icon simply stays desaturated until the next out-of-combat rebuild.
  • A BAG_UPDATE_DELAYED listener triggers a rebuild when bag contents change (out of combat), guarded by a cheap scan (_AnyBarHidesEmptyHealthstone) so it only fires for users who enabled the option.

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 per-bar option to completely hide the Healthstone preset icon when the player has zero Healthstones in bags, and triggers out-of-combat reanchoring when bag contents change to let layouts reflow.

Changes:

  • Add _AnyBarHidesEmptyHealthstone() and hook BAG_UPDATE_DELAYED to queue a reanchor when the option is enabled.
  • In CollectAndReanchor, conditionally hide Healthstone preset frames when bag count is zero (including alternate item IDs).
  • Add “Hide Empty Healthstone” toggle to the options UI and force a rebuild/preview refresh when changed.

Reviewed changes

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

File Description
EllesmereUICooldownManager/EllesmereUICdmHooks.lua Adds bag-driven reanchor and conditional hiding of Healthstone preset frames when empty.
EllesmereUICooldownManager/EUI_CooldownManager_Options.lua Adds UI toggle to enable/disable hiding empty Healthstones per bar.

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

Comment on lines +1844 to +1847
if f and barData and barData.hideEmptyHealthstone
and f._presetData and f._presetData.key
and (f._presetData.key == "healthstone" or f._presetData.key == "demonic_healthstone") then
local cnt = C_Item.GetItemCount(itemID, false, true) or 0
Comment on lines +1855 to +1857
if f and skipEmpty then
f:Hide()
elseif f then
Comment on lines +1847 to +1852
local cnt = C_Item.GetItemCount(itemID, false, true) or 0
if cnt == 0 and f._presetData.altItemIDs then
for _, altID in ipairs(f._presetData.altItemIDs) do
cnt = cnt + (C_Item.GetItemCount(altID, false, true) or 0)
end
end
Comment on lines +1347 to +1349
if event == "BAG_UPDATE_DELAYED" and not InCombatLockdown() and _AnyBarHidesEmptyHealthstone() then
if ns.QueueReanchor then ns.QueueReanchor() end
end
Adds a per-bar toggle (CD/utility custom bars) that hides the Healthstone
icon entirely when the player has none in bags, instead of showing it
desaturated.

- Gated at injection in CollectAndReanchor so the layout reflows; only
  applies to the healthstone/demonic_healthstone presets, counting the
  preset's altItemIDs too. Layout changes are combat-locked, so in combat
  the icon stays desaturated until the rebuild fires.
- A BAG_UPDATE_DELAYED listener triggers a rebuild when bag contents change.
  A change that lands mid-combat is deferred to PLAYER_REGEN_ENABLED (layout
  is locked in combat), so an emptied healthstone hides as soon as combat
  ends rather than waiting for the next bag event. Both paths are guarded by
  a cheap scan (_AnyBarHidesEmptyHealthstone) so they only run for users who
  enabled the option.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Trenchfoote Trenchfoote force-pushed the feat/cdm-hide-empty-healthstone branch from efad473 to 885099a Compare June 7, 2026 19:47
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