Quantcast WoWInterface - View Single Post - Caching talent info
View Single Post
08-26-14, 02:35 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,346
Well thought I found a solution but I suspect it is bugged based on my results.

Functions I have been using:
Lua Code:
  1. local numClasses = GetNumClasses()
  2. local classDisplayName, classTag, classID = GetClassInfo(classIndex)  -- classIndex ( 1 to numClasses )
  3. local numSpecs = GetNumSpecializationsForClassID(classID)
  4. local specID, specName, description, specIcon, background, role = GetSpecializationInfoForClassID(classIndex, specIndex) -- classIndex ( 1 to numClasses ) specIndex ( 1 to numSpecs )
  5. local spells = { GetSpecializationSpells(specID) } -- returns a list of spellID,levelLearned values
  6. local spellName = GetSpellInfo(spellID)
  7. local spellLink = GetSpellLink(spellID)
  8.  
  9. -- This I suspect is the correct one to use to look at the Player/Inspected talents
  10. --local talentID, talentName, talentIcon, selected, available = GetTalentInfo(tier, column, specIndex)
  11.  
  12. -- This I suspect is the correct one to use to look at any Spec but for some reason it looks at the specIndex rather than the specID.  I tried both and only the former works and grabs the talents for the active player's talents and I suspect the inspected player's talents as requested
  13. local talentID,talentName,talentIcon,selected,available = GetTalentInfoBySpecialization(specIndex,tier,column)
  14.  
  15. In these two functions tier is 1 to MAX_TALENT_TIERS and column is 1 to NUM_TALENT_COLUMNS as currently defined in the Blizzard Talent Frame source code.
  16.  
  17. The reason I suspect these are faulty is because I cannot believe that they have 2 differently named functions with the same parameters ( albeit in a different order ) that return the same values.
  18.  
  19. local talentLink = GetTalentLink(talentID)
All of these functions work as expected apart from the GetTalentInfoBySpecialization which I suspect isn't working right.

EG.

This is an example output if I used specID in that function for each tier/column
Lua Code:
  1. classTag = DRUID - specIndex = 1 - specID = 102 - specName = Balance - talentID = nil - talentName = nil
  2. classTag = DRUID - specIndex = 2 - specID = 103 - specName = Feral - talentID = nil - talentName = nil
  3. classTag = DRUID - specIndex = 3 - specID = 104 - specName = Guardian - talentID = nil - talentName = nil
  4. classTag = DRUID - specIndex = 4 - specID = 105 - specName = Restoration - talentID = nil - talentName = nil
This is an example output for the last talent in each of the specIndex's for the players class regardless of which class/spec is being requested.

Lua Code:
  1. classTag = DRUID - specIndex = 1 - specID = 102 - specName = Balance - talentID = 21673 - talentName = Saved By The Light  (Holy Spec for my active Paladin Class - which is my 2nd talent spec)
  2. classTag = DRUID - specIndex = 2 - specID = 103 - specName = Feral - talentID = 21203 - talentName = Holy Shield ( Protection Spec for my active Paladin Class - 1st talent spec )
  3. classTag = DRUID - specIndex = 3 - specID = 104 - specName = Guardian - talentID = 21672 - talentName = Final Verdict ( suspect Retribution Spec for Paladin class - not chosen as a talent )
  4. classTag = DRUID - specIndex = 4 - specID = 105 - specName = Restoration - talentID = nil - talentName = nil  - Paladin's don't have 4 talent choices.

These 3 paladin spec talents are displayed for each class's spec selections. A quick jump onto a few other classes and the appropriate loaded characters talents are displayed instead of the requested specIndex's talent section.
__________________