Use ClassicAPI for action-bar mapping, spell IDs, and dynamic pfUI icons

GetActionInfo:
- Add ClassicAPI.GetActionInfo wrapper; rewrite GetActionButtonInfo
  (Generic.lua) to use it and resolve names via GetSpellRecField /
  GetItem / GetMacroInfo, replacing the per-slot GameTooltip scan +
  texture heuristic. Powers reactive-ability slot detection.
- Delete the dead SuperWoW-GetActionText copy of GetActionButtonInfo.

Spell IDs in the index:
- IndexSpells now uses ClassicAPI GetSpellInfo(slot, bookType), whose
  10th return is the spellID, so every Spells entry carries .id (one
  call also replaces GetSpellName + GetSpellTexture).

Dynamic pfUI action-button icons (pairs with the pfUI fork change):
- GameTooltip.SetAction hook renders spells via ClassicAPI
  SetSpellByID(spell.id) instead of SetSpell(spellSlot, bookType) +
  manual rank text. Items stay location-based (instance data).
- Drop the redundant GetActionSpellSlot -> GetSpellCooldown cooldown
  shim in the pfUI handler; pfUI now routes through the hooked
  GetActionCooldown when it defers macro scanning to us.
This commit is contained in:
Brues
2026-06-21 00:11:46 -05:00
parent b28f4452b9
commit 73e8938d76
6 changed files with 67 additions and 108 deletions
+16
View File
@@ -82,6 +82,22 @@ API references are line numbers into `C:\Git\ClassicAPI\docs\API.md`.
## Tier 2 — replace custom scanning / extra deps
### `GetActionInfo(slot)` — action-slot → spell/macro/item mapping
- **API:** `API.md:489` — returns `actionType, id, subType`.
- **DONE:** `ClassicAPI.GetActionInfo` wrapper added; `GetActionButtonInfo`
(`Extensions/Tooltip/Generic.lua`) rewritten to use it and resolve names via
`GetSpellRecField` / `GetItem` / `GetMacroInfo`, replacing the per-slot
GameTooltip scan + texture heuristic (which couldn't tell spell from item and
never recognized macros). Powers reactive-ability slot detection
(`IndexActionSlot`). Deleted the dead SuperWoW-`GetActionText` copy of
`GetActionButtonInfo` in `Conditionals.lua`.
- **Known limitation:** GetActionInfo returns `id = nil` for bag-instance items
(items dragged from bags rather than placed by itemID), so those slots get no
name. The consumers (`actionSlots` for `/startattack`·`/shoot`·auto-shot
proxies, reactive spells) only need spells, so this is acceptable.
- **Follow-up (optional):** migrate the remaining `GetActionText` macro-slot
detection in `Core.lua` / `ComboPointTracker.lua` to `GetActionInfo` too.
### 4. `C_Spell.*` / `GetSpellInfo(spellID)`
- **API:** `API.md:6649+` — `GetSpellCooldown`, `IsUsableSpell`, `IsSpellKnown`,
`SpellHasRange`, `GetSpellSchool`, `FindSpellBookSlotByID`.