I'm using "spell" and spell name too
As attributes.
Yes, I checked, when dragged from secure buttons its old "mount" and old style spellbook index (slot) ... But
Code:
for slot = 1, GetNumCompanions(compType) do
--creatureID, creatureName, creatureSpellID, icon, issummoned
local creatureID, name, id = GetCompanionInfo(compType, slot)
print(creatureID, name, id)
local spellName = GetSpellInfo(id)
if spellName then
cache2slot[spellName] = {slot, compType}
print("CacheCompanionSpells", spellName, slot, compType)
end
end
not works anymore for "MOUNT" (returns nils). What a mess ...
Found short way of getting mount journal index to spell id without hooks to MountJournal buttons "OnEnter". It's
Code:
for i=1, C_MountJournal.GetNumMounts() do
local creatureName, spellID, icon, active, isUsable, sourceType, isFavorite, _, _, hideOnChar, isCollected = C_MountJournal.GetMountInfo(i)
MountJournalIndexToSpellID[i] = spellID
end
I think it will be broken until some 6.2 patch (as always). Maybe we should stop making hacks to make our addons almost working. Let players whining and complaining on Blizzard forums about broken addons. To force Blizzard make proper API.
P.S. I disabled battlepet's support completely in my addons. Except I like to have several my favorite mounts in short dropdown list ..