The CastSpell and UseAction hooks were doing too much work (tooltip
manipulation, spell name detection, combo point tracking) which was
interfering with WoW's action bar icon updates.
Solution:
Made both hooks minimal pass-throughs that just call and return the
original function. Combo point tracking is now handled entirely by:
1. UpdateComboPoints() - runs continuously via OnUpdate, captures
combo points as they're generated and stores in lastComboPoints
2. SPELLCAST_START event - fires for ALL spell casts regardless of
source (spellbook, action bar, macro, keybind) and calls
TrackComboPointCast()
3. TrackComboPointCast() - uses GetComboPoints() first, falls back
to lastComboPoints if points are already consumed
This approach works for all casting methods:
- Spellbook clicks
- Action bar clicks
- Keybinds
- Macros with /cast
- Macros with conditionals
And doesn't interfere with action bar icon updates (GCD, range
coloring, queue glowing, etc).
Previously, action button state functions (IsCurrentAction, IsActionInRange,
IsUsableAction, ActionHasRange, GetActionCount, IsConsumableAction) only
checked the active action, not the tooltip action. This caused issues when
using #showtooltip without conditionals, or when no conditionals matched:
- No glow on buttons even when the ability was queued/active
- Incorrect range/usability indicators
- Missing item counts for consumables
Now all these functions use the same priority as GetActionTexture and
GetActionCooldown: check the active action first, then fall back to the
tooltip action. This ensures button states match the displayed icon.
Fixes issues with abilities like Cleave and Heroic Strike not showing glow
when queued, and ensures all action button visuals are consistent.
When #showtooltip had an argument with conditionals (e.g., #showtooltip [stance:1] Fireball),
the code was trying to find a spell named "[stance:1] Fireball" which doesn't exist.
This resulted in no texture being found for the tooltip action, causing incorrect icons.
Now the code parses the argument first using GetParsedMsg() to extract just the spell name
before creating the tooltip action info. This allows it to properly find the spell in the
spellbook and retrieve its correct texture/icon.
The CastSpell and UseAction hooks were breaking action bar icon
updates (GCD display, range coloring, queue glowing) because they
weren't returning the values from the original functions.
Issues fixed:
1. Return values: Both hooks now capture and return all return values
from the original functions, ensuring the game receives the expected
data for action bar updates
2. Error protection: Wrapped all tracking code in pcall() to prevent
any errors from breaking the normal spell cast flow
3. Tooltip interference: UseAction now uses a separate hidden tooltip
(CleveRoidsComboTooltip) instead of manipulating GameTooltip,
avoiding interference with the main UI tooltip
Changes to CastSpell hook:
- Use pcall for GetSpellName to safely handle errors
- Capture return values: result1, result2, result3
- Wrap tracking code in pcall for error protection
- Return all captured values
Changes to UseAction hook:
- Wrap entire spell name detection in pcall
- Create separate hidden tooltip for combo point spells
- Capture return values from original UseAction
- Wrap tracking code in pcall for error protection
- Return all captured values
This ensures action bar icons work correctly while still tracking
combo points for finisher spells.