Skip to content

Track shared potion cooldown - #11

Merged
pedrozc90 merged 1 commit into
masterfrom
issues/potions-cooldown
Nov 1, 2026
Merged

pedrozc90 merged 1 commit into
masterfrom
issues/potions-cooldown

Conversation

@pedrozc90

Copy link
Copy Markdown
Member

Shows one icon for the shared potion cooldown, without listing potion item IDs.

Changes

  • data.CreatePotionCooldown(enabled) adds one potion row to the shared gear cooldowns.
  • The cooldown element scans the bags at load and on BAG_UPDATE_DELAYED. It maps each potion's use spell to its item ID. A potion is any item with class Consumable / subclass Potion.
  • When a mapped spell is cast (UNIT_SPELLCAST_SUCCEEDED), the row switches to that item and reads its cooldown with C_Container.GetItemCooldown.
  • Potions stay mapped after they leave the bags, so the last potion's running cooldown stays shown.
  • The potion icon shows the item tooltip.
  • /filger dump and tests/dump.lua label the potion row.

Tested

  • MoP Classic:
    • The icon shows after drinking, with the correct timer.
    • The tooltip works.
    • Drinking the last potion keeps the icon.
    • A potion-class item with its own cooldown (86569) takes over the icon when used.
  • make check and make test pass.

Not tested yet

  • Era / TBC: whether SPELL_UPDATE_COOLDOWN fires on potion cooldowns. If it doesn't, these clients need BAG_UPDATE_COOLDOWN.
  • Era: whether potions have item class 0 / subclass 1.
  • Retail: whether healing and combat potions share a cooldown.
  • MoP: drinking in combat.
  • After /reload during a running potion cooldown, the icon only returns after the next drink.

Closes #7

- data: add CreatePotionCooldown, one row in shared gear cooldowns
- cooldowns: find potions in the bags by item class, no item IDs
- cooldowns: follow the potion that was drunk, by its use spell
- cooldowns: keep the last potion so a running cooldown stays shown
- tooltip: show item tooltips for potion icons
- dev, tests: label the potion row in dumps

Closes #7
@pedrozc90 pedrozc90 linked an issue Nov 1, 2026 that may be closed by this pull request
8 tasks
@pedrozc90
pedrozc90 merged commit c50b53f into master Nov 1, 2026
2 checks passed
@pedrozc90
pedrozc90 deleted the issues/potions-cooldown branch November 1, 2026 15:11
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.

Track shared potion cooldown

1 participant