View Single Post
03-27-14, 05:32 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Duugu View Post
New idea: I'll query all flyoutIDs up to ... whatever ... 1k and query and store all slots for flyoutIDs that exist on addon load.
That seems like a lot of unnecessary scanning. Just scan the player's spellbook for the flyouts that are actually available to them.

Lua Code:
  1. local _, _, offset, numSpells = GetSpellTabInfo(2)
  2. for i = offset, numSpells do
  3.     local skillType, skillID = GetSpellBookItemInfo("spell", i)
  4.     if skillType == "FLYOUT" then
  5.         local _, _, numSlots, isKnown = GetFlyoutInfo(skillID)
  6.         for j = 1, numSlots do
  7.             local spellID, overrideSpellID, isKnown, spellName, slotSpecID = GetFlyoutSlotInfo(skillID, j)
  8.         end
  9.     end
  10. end

(I'm pretty sure nobody has any flyouts on the General tab, but if they do, just start the i loop from 1 instead of offset.)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote