Commit Graph

24 Commits

Author SHA1 Message Date
Brues 782c685fba Replace tooltip-scanning GetSpellCost with ClassicAPI DBC reads
GetSpellCost now reads power cost and reagents straight from Spell.dbc via
C_Spell.GetSpellPowerCost (effective, talent-modified cost) and
C_Spell.GetSpellReagents (itemID), dropping the GameTooltip owner/scan
frames, their font strings, and all locale-dependent line parsing.

Reagent counting is now itemID-based end to end: GetReagentCount takes an
itemID and matches by id in the Items cache / bag scan. This removes the
hardcoded English reagent tables (_ReagentBySpell, _ReagentIdByName) and
the name-matching bag-scan tooltip, so it works on any client locale.
Verified in-game that GetSpellReagents covers DBC reagent spells (Vanish
-> Flash Powder), which the hand table previously special-cased.

The localized reagent name is still used for countedItemTypes registration
(recognizing a reagent item placed on the action bar); when that name
isn't cached yet, warm it via the ClassicAPI Item mixin
(Item:CreateFromItemID/ContinueOnItemLoad) and register it once it lands.
2026-07-19 16:34:19 -05:00
Brues b84835a567 Use GetInventoryItemID instead of string parsing 2026-07-17 21:25:25 -05:00
Brues 40cf2c8010 More ClassicAPI porting 2026-07-15 19:45:31 -05:00
Brues 6e57ff01dc Adopt ClassicAPI C_Item item reads in Tooltip/Generic.lua indexers
Migrate the link-scrape-then-discard sites to direct ClassicAPI reads:

- IndexEquippedItems / IndexEquipSlot: GetInventoryItemID for the id
  (GetItemInfo still supplies the stored base link/texture)
- IndexItems bag+equip scans: GetContainerItemID/GetInventoryItemID +
  C_Item.GetItemName (decorated) for the dedup fast-path; drop the now
  dead GetContainerItemLink/GetInventoryItemLink locals
- GetItemFast cache validation: alloc-free id compare via
  GetInventoryItemID/GetContainerItemID, decorated-name compare otherwise
- IsItemEquipped: GetInventoryItemID + C_Item.GetItemName

Left untouched: makeInventoryItem/makeBagItem and the GetItem/GetItemFast
scan loops, which build a real link that is stored on the item and later
fed to GameTooltip:SetHyperlink.

Note: the equipped-scan loops now start at slot 1 (GetInventoryItemID
requires slot>=1), so the ammo slot (0) is no longer walked by these
indexers -- ammo is not referenced by name anywhere in the addon.
2026-07-15 19:33:07 -05:00
Brues 73e8938d76 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.
2026-06-21 00:11:46 -05:00
Jrc13245 4a34cf25ce fix talent error 2026-03-20 13:37:50 -04:00
Jrc13245 a50a5c7e7c use pfui swingtimer if SP not available, fix vanish regeant count 2026-02-27 07:59:05 -05:00
Jrc13245 eede643540 optimize buff and debuff checks and update functions to nampower v2_18_0 2025-12-17 16:29:32 -05:00
Jrc13245 ed67c38b0f fix multi use for some conditionals 2025-12-16 15:03:29 -05:00
Jrc13245 2fd4ac3298 reduce bag event usage for lag and fix macro calling within macros 2025-12-12 15:43:21 -05:00
Jrc13245 86fa4476f6 fix equip with conditionals and dont pollute runmacro global namespace 2025-12-05 18:26:33 -05:00
Jrc13245 04f4eacac8 nested macro showtooltip support, nampower queue casting integration, relic slot optimizations, performance updates 2025-12-04 18:10:30 -05:00
Jrc13245 87183b6e09 fix fallback for channeled spell icons and final fixes for swapping items in combat lag. 2025-12-03 14:41:13 -05:00
Jrc13245 30ed4e2bf9 improve targeting function and further improve equipment mid combat lag. 2025-12-03 08:22:46 -05:00
Jrc13245 33ffd85782 lesse in combat item swapping lag and fix errors. 2025-12-02 17:20:40 -05:00
Jrc13245 21119c8bd5 fix reactive for overpower and revenge to see as active in any stance. 2025-11-25 16:58:44 -05:00
Jrc13245 7b4fb6e9d2 prevent rare name index error in languages where there is no upper or lower case 2025-11-20 19:54:42 -05:00
Jrc13245 1b1d4fe94b revert some changes 2025-11-10 19:59:13 -05:00
Jrc13245 4920675a3a fix errors 2025-11-10 19:38:44 -05:00
Jrc13245 8be3d7df3a fix some tooltip errors 2025-10-28 19:43:39 -04:00
Jrc13245 18f7828c26 fix non-letter or number characters in item or spell names 2025-10-26 12:48:29 -04:00
Jrc13245 4c9c6fff60 new pet conditional 2025-10-08 20:46:03 -04:00
Jrc13245 c2de86b3a6 fix use command to take itemid and names in conditionals and with their slotid 2025-09-30 17:18:26 -04:00
Jrc13245 fb359993b2 Initial Commit 2025-08-18 16:15:25 -04:00