View Single Post
09-20-22, 06:58 PM   #7
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,943
Okay, this bit of code allowed me to get hold of some spec and talent information. At the moment it is coded for the player but there looks like you might be able to use it for inspect purposes as well but not sure where the restrictions might be there. But hopefully it will get you part way there.

wherever the nil is the code had TalentFrame.inspect
wherever PLAYER is the code had either PLAYER or talentUnit which was passed into the Update function for the TalentFrame.


Lua Code:
  1. local addonName, addonData = ...
  2.  
  3. XrystalUI_Traits_SV = {}
  4.  
  5. local talentsLoaded = false
  6. local addonLoaded = false
  7. local variablesLoaded = false
  8.  
  9. local function DoStuff()
  10.        
  11.     local activeSpecGroup = GetActiveSpecGroup(false)
  12.     local numSpecGroups = GetNumSpecGroups(false)
  13.    
  14.     XrystalUI_Traits_SV["ActiveSpecGroup"] = activeSpecGroup
  15.     XrystalUI_Traits_SV["NumSpecGroups"] = numSpecGroups
  16.    
  17.     local spec = GetSpecialization(nil, false, activeSpecGroup);
  18.     XrystalUI_Traits_SV["Specialization"] = spec
  19.     XrystalUI_Traits_SV["SpecializationInfo"] = { GetSpecializationInfo(spec)}
  20.    
  21.     XrystalUI_Traits_SV["TierInfo"] = {}
  22.     XrystalUI_Traits_SV["TalentInfo"] = {}
  23.  
  24.  
  25.     for tier=1, MAX_TALENT_TIERS do
  26.         local tierAvailable, selectedTalent, tierUnlockLevel = GetTalentTierInfo(tier, activeSpecGroup, nil, "PLAYER");
  27.         table.insert(XrystalUI_Traits_SV["TierInfo"],{ GetTalentTierInfo(tier, activeSpecGroup, nil, "PLAYER")})
  28.         for column=1, NUM_TALENT_COLUMNS do
  29.             local talentID, name, iconTexture, selected, available, _, _, _, _, _, grantedByAura = GetTalentInfo(tier, column, activeSpecGroup, nil, "PLAYER")                        
  30.             table.insert(XrystalUI_Traits_SV["TalentInfo"],{ GetTalentInfo(tier, column, activeSpecGroup, nil, "PLAYER")})
  31.         end
  32.     end
  33.  
  34. end
  35.  
  36. local function OnEvent(self,event,...)
  37.     local args = {...}
  38.     print(event,...)
  39.     if event == "ADDON_LOADED" then
  40.         if args[1] == "Blizzard_TalentUI" then
  41.             talentsLoaded = true
  42.         elseif args[1] == addonName then
  43.             addonLoaded = true
  44.             if not talentsLoaded then
  45.                 LoadAddOn("Blizzard_TalentUI")
  46.             end
  47.         end
  48.     elseif event == "VARIABLES_LOADED" then
  49.             XrystalUI_Traits_SV = {}        -- Start with a fresh table for testing purposes
  50.             variablesLoaded = true
  51.     elseif event == "PLAYER_LOGIN" then
  52.         DoStuff()
  53.     end
  54. end
  55.  
  56.  
  57. local frame = CreateFrame("Frame")
  58. frame:RegisterEvent("ADDON_LOADED")
  59. frame:RegisterEvent("VARIABLES_LOADED")
  60. frame:RegisterEvent("PLAYER_LOGIN")
  61. frame:SetScript("OnEvent", OnEvent)


The DoStuff function resulted in this Saved Variable Table of Data
Lua Code:
  1. XrystalUI_Traits_SV = {
  2.     ["Specialization"] = 3,
  3.     ["TierInfo"] = {
  4.         {
  5.             false, -- [1]
  6.             0, -- [2]
  7.             15, -- [3]
  8.         }, -- [1]
  9.         {
  10.             false, -- [1]
  11.             0, -- [2]
  12.             25, -- [3]
  13.         }, -- [2]
  14.         {
  15.             false, -- [1]
  16.             0, -- [2]
  17.             30, -- [3]
  18.         }, -- [3]
  19.         {
  20.             false, -- [1]
  21.             0, -- [2]
  22.             35, -- [3]
  23.         }, -- [4]
  24.         {
  25.             false, -- [1]
  26.             0, -- [2]
  27.             40, -- [3]
  28.         }, -- [5]
  29.         {
  30.             false, -- [1]
  31.             0, -- [2]
  32.             45, -- [3]
  33.         }, -- [6]
  34.         {
  35.             false, -- [1]
  36.             0, -- [2]
  37.             100, -- [3]
  38.         }, -- [7]
  39.     },
  40.     ["ActiveSpecGroup"] = 1,
  41.     ["NumSpecGroups"] = 1,
  42.     ["TalentInfo"] = {
  43.         {
  44.             22419, -- [1]
  45.             "Brambles", -- [2]
  46.             415052, -- [3]
  47.             false, -- [4]
  48.             false, -- [5]
  49.             203953, -- [6]
  50.             nil, -- [7]
  51.             1, -- [8]
  52.             1, -- [9]
  53.             false, -- [10]
  54.             false, -- [11]
  55.         }, -- [1]
  56.         {
  57.             22418, -- [1]
  58.             "Blood Frenzy", -- [2]
  59.             132139, -- [3]
  60.             false, -- [4]
  61.             false, -- [5]
  62.             203962, -- [6]
  63.             nil, -- [7]
  64.             1, -- [8]
  65.             2, -- [9]
  66.             false, -- [10]
  67.             false, -- [11]
  68.         }, -- [2]
  69.         {
  70.             22420, -- [1]
  71.             "Bristling Fur", -- [2]
  72.             1033476, -- [3]
  73.             false, -- [4]
  74.             false, -- [5]
  75.             155835, -- [6]
  76.             nil, -- [7]
  77.             1, -- [8]
  78.             3, -- [9]
  79.             false, -- [10]
  80.             false, -- [11]
  81.         }, -- [3]
  82.         {
  83.             19283, -- [1]
  84.             "Tiger Dash", -- [2]
  85.             1817485, -- [3]
  86.             false, -- [4]
  87.             false, -- [5]
  88.             252216, -- [6]
  89.             nil, -- [7]
  90.             2, -- [8]
  91.             1, -- [9]
  92.             false, -- [10]
  93.             false, -- [11]
  94.         }, -- [4]
  95.         {
  96.             18570, -- [1]
  97.             "Renewal", -- [2]
  98.             136059, -- [3]
  99.             false, -- [4]
  100.             false, -- [5]
  101.             108238, -- [6]
  102.             nil, -- [7]
  103.             2, -- [8]
  104.             2, -- [9]
  105.             false, -- [10]
  106.             false, -- [11]
  107.         }, -- [5]
  108.         {
  109.             18571, -- [1]
  110.             "Wild Charge", -- [2]
  111.             538771, -- [3]
  112.             false, -- [4]
  113.             false, -- [5]
  114.             102401, -- [6]
  115.             nil, -- [7]
  116.             2, -- [8]
  117.             3, -- [9]
  118.             false, -- [10]
  119.             false, -- [11]
  120.         }, -- [6]
  121.         {
  122.             22163, -- [1]
  123.             "Balance Affinity", -- [2]
  124.             236156, -- [3]
  125.             false, -- [4]
  126.             false, -- [5]
  127.             197488, -- [6]
  128.             nil, -- [7]
  129.             3, -- [8]
  130.             1, -- [9]
  131.             false, -- [10]
  132.             false, -- [11]
  133.         }, -- [7]
  134.         {
  135.             22156, -- [1]
  136.             "Feral Affinity", -- [2]
  137.             611425, -- [3]
  138.             false, -- [4]
  139.             false, -- [5]
  140.             202155, -- [6]
  141.             nil, -- [7]
  142.             3, -- [8]
  143.             2, -- [9]
  144.             false, -- [10]
  145.             false, -- [11]
  146.         }, -- [8]
  147.         {
  148.             22159, -- [1]
  149.             "Restoration Affinity", -- [2]
  150.             236157, -- [3]
  151.             false, -- [4]
  152.             false, -- [5]
  153.             197492, -- [6]
  154.             nil, -- [7]
  155.             3, -- [8]
  156.             3, -- [9]
  157.             false, -- [10]
  158.             false, -- [11]
  159.         }, -- [9]
  160.         {
  161.             21778, -- [1]
  162.             "Mighty Bash", -- [2]
  163.             132114, -- [3]
  164.             false, -- [4]
  165.             false, -- [5]
  166.             5211, -- [6]
  167.             nil, -- [7]
  168.             4, -- [8]
  169.             1, -- [9]
  170.             false, -- [10]
  171.             false, -- [11]
  172.         }, -- [10]
  173.         {
  174.             18576, -- [1]
  175.             "Mass Entanglement", -- [2]
  176.             538515, -- [3]
  177.             false, -- [4]
  178.             false, -- [5]
  179.             102359, -- [6]
  180.             nil, -- [7]
  181.             4, -- [8]
  182.             2, -- [9]
  183.             false, -- [10]
  184.             false, -- [11]
  185.         }, -- [11]
  186.         {
  187.             18577, -- [1]
  188.             "Heart of the Wild", -- [2]
  189.             135879, -- [3]
  190.             false, -- [4]
  191.             false, -- [5]
  192.             319454, -- [6]
  193.             nil, -- [7]
  194.             4, -- [8]
  195.             3, -- [9]
  196.             false, -- [10]
  197.             false, -- [11]
  198.         }, -- [12]
  199.         {
  200.             21709, -- [1]
  201.             "Soul of the Forest", -- [2]
  202.             236160, -- [3]
  203.             false, -- [4]
  204.             false, -- [5]
  205.             158477, -- [6]
  206.             nil, -- [7]
  207.             5, -- [8]
  208.             1, -- [9]
  209.             false, -- [10]
  210.             false, -- [11]
  211.         }, -- [13]
  212.         {
  213.             21707, -- [1]
  214.             "Galactic Guardian", -- [2]
  215.             135853, -- [3]
  216.             false, -- [4]
  217.             false, -- [5]
  218.             203964, -- [6]
  219.             nil, -- [7]
  220.             5, -- [8]
  221.             2, -- [9]
  222.             false, -- [10]
  223.             false, -- [11]
  224.         }, -- [14]
  225.         {
  226.             22388, -- [1]
  227.             "Incarnation: Guardian of Ursoc", -- [2]
  228.             571586, -- [3]
  229.             false, -- [4]
  230.             false, -- [5]
  231.             102558, -- [6]
  232.             nil, -- [7]
  233.             5, -- [8]
  234.             3, -- [9]
  235.             false, -- [10]
  236.             false, -- [11]
  237.         }, -- [15]
  238.         {
  239.             22423, -- [1]
  240.             "Earthwarden", -- [2]
  241.             237573, -- [3]
  242.             false, -- [4]
  243.             false, -- [5]
  244.             203974, -- [6]
  245.             nil, -- [7]
  246.             6, -- [8]
  247.             1, -- [9]
  248.             false, -- [10]
  249.             false, -- [11]
  250.         }, -- [16]
  251.         {
  252.             21713, -- [1]
  253.             "Survival of the Fittest", -- [2]
  254.             132126, -- [3]
  255.             false, -- [4]
  256.             false, -- [5]
  257.             203965, -- [6]
  258.             nil, -- [7]
  259.             6, -- [8]
  260.             2, -- [9]
  261.             false, -- [10]
  262.             false, -- [11]
  263.         }, -- [17]
  264.         {
  265.             22390, -- [1]
  266.             "Guardian of Elune", -- [2]
  267.             1033479, -- [3]
  268.             false, -- [4]
  269.             false, -- [5]
  270.             155578, -- [6]
  271.             nil, -- [7]
  272.             6, -- [8]
  273.             3, -- [9]
  274.             false, -- [10]
  275.             false, -- [11]
  276.         }, -- [18]
  277.         {
  278.             22426, -- [1]
  279.             "Rend and Tear", -- [2]
  280.             132143, -- [3]
  281.             false, -- [4]
  282.             false, -- [5]
  283.             204053, -- [6]
  284.             nil, -- [7]
  285.             7, -- [8]
  286.             1, -- [9]
  287.             false, -- [10]
  288.             false, -- [11]
  289.         }, -- [19]
  290.         {
  291.             22427, -- [1]
  292.             "Tooth and Claw", -- [2]
  293.             134298, -- [3]
  294.             false, -- [4]
  295.             false, -- [5]
  296.             135288, -- [6]
  297.             nil, -- [7]
  298.             7, -- [8]
  299.             2, -- [9]
  300.             false, -- [10]
  301.             false, -- [11]
  302.         }, -- [20]
  303.         {
  304.             22425, -- [1]
  305.             "Pulverize", -- [2]
  306.             1033490, -- [3]
  307.             false, -- [4]
  308.             false, -- [5]
  309.             80313, -- [6]
  310.             nil, -- [7]
  311.             7, -- [8]
  312.             3, -- [9]
  313.             false, -- [10]
  314.             false, -- [11]
  315.         }, -- [21]
  316.     },
  317.     ["SpecializationInfo"] = {
  318.         104, -- [1]
  319.         "Guardian", -- [2]
  320.         "Takes on the form of a mighty bear to absorb damage and protect allies.\r\n\r\nPreferred Weapon: Staff, Polearm", -- [3]
  321.         132276, -- [4]
  322.         "TANK", -- [5]
  323.         2, -- [6]
  324.     },
  325. }
__________________


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
  Reply With Quote