CDM: add "Hide Empty Healthstone" option#366
Open
Trenchfoote wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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 hookBAG_UPDATE_DELAYEDto 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>
efad473 to
885099a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.