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
+6 -18
View File
@@ -4366,15 +4366,10 @@ function GameTooltip.SetAction(self, slot)
-- End new logic
local current_spell_data = CleveRoids.GetSpell(action_name)
if current_spell_data then
GameTooltip:SetSpell(current_spell_data.spellSlot, current_spell_data.bookType)
local rank_info = current_spell_data.rank or (current_spell_data.highest and current_spell_data.highest.rank)
if rank_info and rank_info ~= "" then
GameTooltipTextRight1:SetText("|cff808080" .. rank_info .. "|r")
else
GameTooltipTextRight1:SetText("")
end
GameTooltipTextRight1:Show()
if current_spell_data and current_spell_data.id then
-- ClassicAPI: render by spellID (rank included) instead of routing
-- through the spellbook slot via SetSpell(spellSlot, bookType).
GameTooltip:SetSpellByID(current_spell_data.id)
GameTooltip:Show()
return
end
@@ -4399,15 +4394,8 @@ function GameTooltip.SetAction(self, slot)
local nested_action_name = nested_action_info.action
current_spell_data = CleveRoids.GetSpell(nested_action_name)
if current_spell_data then
GameTooltip:SetSpell(current_spell_data.spellSlot, current_spell_data.bookType)
local rank_info = current_spell_data.rank or (current_spell_data.highest and current_spell_data.highest.rank)
if rank_info and rank_info ~= "" then
GameTooltipTextRight1:SetText("|cff808080" .. rank_info .. "|r")
else
GameTooltipTextRight1:SetText("")
end
GameTooltipTextRight1:Show()
if current_spell_data and current_spell_data.id then
GameTooltip:SetSpellByID(current_spell_data.id)
GameTooltip:Show()
return
end