Skip to content

Track shared potion cooldown #7

Closed

Description

@pedrozc90

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

Why not item IDs

  • Using one potion puts every potion in the bags on cooldown; one icon per potion duplicates the timer.
  • Potion IDs change every patch/expansion; a list in data/ needs constant upkeep.

Current state

  • ProcessCooldownData already has a data.itemId branch (GetItemInfo, C_Container.GetItemCooldown), and button_proto OnEnter tooltips handle itemId.
  • The branch is unreachable: core/data.lua has no item constructor, and buildCooldowns drops rows without slotId or a known spellId.
  • Events suffice: on Retail and MoP, SPELL_UPDATE_COOLDOWN fires on every item cooldown change (Experiment 10, docs/secret-values-options.md). Item rows have no spellId, so they are always re-checked.

Proposal

One "potion" row with no ID that resolves to whichever potion is in the bags:

  • Match by item class: C_Item.GetItemInfoInstant(itemID) → classID, subClassID; potion = Enum.ItemClass.Consumable (0) / Enum.ItemConsumableSubclass.Potion (1). Both exist in the generated docs of every client.
  • Scan bags (C_Container.GetContainerNumSlots, C_Container.GetContainerItemID) only on BAG_UPDATE_DELAYED, never on cooldown events. Cache the ID.
  • Keep the last ID after the last potion is drunk so the running cooldown still shows.
  • Read the cooldown through the existing itemId branch.

Tasks

  • Experiments (/filger exp10 <potionID>, prints enabled):
    • MoP: drink in combat, leave combat. Is enabled 0 in combat while start follows GetTime()? Does the cooldown start when combat ends?
    • Era and TBC: same test.
    • Retail: do healing and combat potions share a cooldown? Healthstones? (unverified)
    • Era: are potions classID 0 / subClassID 1, or Generic (0)? (unverified; /run print(C_Item.GetItemInfoInstant(<id>)))
  • Data: data.CreatePotionCooldown(enabled) in core/data.lua, one row in data/shared/cooldowns.lua gear, accepted by buildCooldowns.
  • Resolve: bag scan setting the row's itemId, at login and on BAG_UPDATE_DELAYED, registered only by the cooldown element.
  • Classic in combat: if experiments confirm the pending cooldown, keep the icon hidden while enabled is 0 (FilterCooldown already requires data.enabled).

Open questions

  • With potions from different cooldown groups in the bags, which one wins? Unknown until the experiments.

Activity

  1. added theissue type on Nov 1, 2026
  2. linked a pull request that will close this issueTrack shared potion cooldown #11on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions