View Single Post
10-14-23, 06:38 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,938
I suspect this is one of those areas where they pulled in the retail version of the Collections system rather than grab out the old classic version.

I'm gonna see if I can simulate that for loop with the new functionality in 3.4.3 but I've not touched this part of the API before so in the mean time ... here's the warcraft.wiki ( formerly known as wowpedia rofl ) for what I think they have replaced it with.

https://warcraft.wiki.gg/wiki/World_...PI#Collections


Yep, this seems to be working as I thought. Here's the lua and toc for a quick test addon

Lua Code:
  1. local function CheckMounts()
  2.     local mountIDs = C_MountJournal.GetMountIDs()
  3.    
  4.     for i = 1, #mountIDs do
  5.         local name, spellID, icon, isActive, isUsable, sourceType, isFavorite, isFactionSpecific, faction, shouldHideOnChar, isCollected, mountID = C_MountJournal.GetMountInfoByID(i)
  6.         print(mountID,name,isCollected,sourceType,spellID,icon,isActive)
  7.     end
  8. end
  9.  
  10. local function OnEvent(self,event,...)    
  11.     if event == "ADDON_LOADED" then
  12.         CheckMounts()
  13.     elseif event == "PLAYER_LOGIN" then
  14.         --CheckMounts()
  15.     end
  16. end
  17.  
  18. local f = CreateFrame("Frame")
  19. f:RegisterEvent("ADDON_LOADED")
  20. f:RegisterEvent("PLAYER_LOGIN")
  21. f:SetScript("OnEvent",OnEvent)


Lua Code:
  1. ## Interface: 30403
  2. ## Version: v0.0.1
  3. ## Title: Collection Info Test
  4. ## Notes: Testing Collection Info functionality
  5. ## Author: Xrystal
  6. ## SavedVariables:
  7. ## Dependencies: Blizzard_Collections
  8. ## OptionalDeps:
  9. ## IconTexture:
  10. ## DefaultState: Enabled
  11. ## LoadOnDemand: 0
  12.  
  13. CollectionInfoTest.lua
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 10-14-23 at 06:53 PM.
  Reply With Quote