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.
Updated GetActionTexture to fall back to the macro's icon in all code paths:
- When no action is active and no explicit tooltip (line 2444)
- When inventory slot is empty (line 2469)
- Final fallback for all other cases (line 2494)
This ensures the macro icon is always shown instead of the question mark
when no action/spell texture is available. The question mark should only
appear as an absolute last resort if GetMacroInfo fails.
Updated fallback logic to always use the macro's chosen icon (from the
macro frame) when no action is active. The priority is now:
1. Tooltip texture (from first action if #showtooltip is present)
2. Macro's icon (from macro frame)
3. Never question mark (unless GetMacroInfo fails, which shouldn't happen)
This ensures the icon properly shows the macro's icon when all
conditionals fail, instead of showing a question mark.
When #showtooltip is used without an explicit spell/item argument and all
conditionals fail, the icon now falls back to the tooltip texture (first
action) instead of immediately showing a question mark. This prevents the
question mark icon from appearing when the macro has valid actions but none
of their conditions are currently met.
Fixes issue where macro icon becomes question mark when no target and
Battle Shout buff is already active.
BUGFIX: Core.lua:2253 attempt to compare nil with number
The cleanup loop was checking 'if time > cast.expires' but some entries
in spell_tracking (like combo tracking data) don't have an expires field.
Added nil check: 'if cast.expires and time > cast.expires'
This prevents errors when combo tracking data is in spell_tracking without
an expiration time.