Thread Tools Display Modes
09-20-22, 05:56 AM   #1
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
Patch 10 - new API?

Where can I get documentation for the new (possibly) API or changes? EG the talent tress are all different, they are more like Classic TBC/Wrath!

Edit: nevermind, I seem to have found a starting point:
https://wowpedia.fandom.com/wiki/Pat....0/API_changes

Last edited by doofus : 09-20-22 at 05:59 AM.
  Reply With Quote
09-20-22, 06:51 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
They were here ( https://github.com/Gethe/wow-ui-source/tree/beta ) but the FrameXML folder has disappeared in the last few days.

So I ended up extracting the files myself so I at least have access to the source files

But yes, the wowpedia page is very useful as I have been having problems getting the new settings system to work in a minimal addon let alone a full one.
__________________


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
09-20-22, 08:43 AM   #3
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
At this stage of my testing, I only want to enumerate the talents. The talent trees resemble Classic/TBC/Wrath, however I cannot use this very simple code:

for i = 1, GetNumTalentTabs() do
for j = 1, GetNumTalents(i) do

local name , _ , _ , _ ,rank = GetTalentInfo(i, j);
if ( rank > 0 ) then
lDeathKnightTalents[name] = rank;
print(string.format("talent:[%s] - rank:[%d]",name,rank));
end

end
end

So I am now investigating the new API, like this

local lTalentConfigID = C_ClassTalents.GetActiveConfigID();
local lConfigInfo = C_Traits.GetConfigInfo(lTalentConfigID);
print(string.format("configID:%d - name:%s - treeIDs:%d - %d - %d",lTalentConfigID,lConfigInfo["name"],#lConfigInfo["treeIDs"],lConfigInfo["treeIDs"][1],lConfigInfo["treeIDs"][2]));

but am stuck there, there is only one tree ID returned. I would be expecting two.

And how to transverse the tree... Just testing
  Reply With Quote
09-20-22, 11:28 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
I found these in the TalentUI lua file which may help you - good luck


Lua Code:
  1. local activeTalentGroup, numTalentGroups = GetActiveSpecGroup(false), GetNumSpecGroups(false);
  2. PlayerTalentFrame.primaryTree = GetSpecialization(PlayerTalentFrame.inspect, false, PlayerTalentFrame.talentGroup);
  3. local primaryTree = GetSpecialization(false, false, spec.talentGroup);

Lua Code:
  1. local numSpecs = GetNumSpecializations(false, self.isPet);
  2. for i = 1,numSpecs do
  3. local _, name, description, icon = GetSpecializationInfo(i, false, self.isPet, nil, sex);
  4. local role = GetSpecializationRole(i, false, self.isPet);
  5. end

Where specs is this local table and spec an element in it
Lua Code:
  1. local specs = {
  2.     ["spec1"] = {
  3.         name = SPECIALIZATION_PRIMARY,
  4.         nameActive = TALENT_SPEC_PRIMARY_ACTIVE,
  5.         specName = SPECIALIZATION_PRIMARY,
  6.         specNameActive = SPECIALIZATION_PRIMARY_ACTIVE,
  7.         talentGroup = 1,
  8.         tooltip = SPECIALIZATION_PRIMARY,
  9.         defaultSpecTexture = "Interface\\Icons\\Ability_Marksmanship",
  10.     },
  11.     ["spec2"] = {
  12.         name = SPECIALIZATION_SECONDARY,
  13.         nameActive = TALENT_SPEC_SECONDARY_ACTIVE,
  14.         specName = SPECIALIZATION_SECONDARY,
  15.         specNameActive = SPECIALIZATION_SECONDARY_ACTIVE,
  16.         talentGroup = 2,
  17.         tooltip = SPECIALIZATION_SECONDARY,
  18.         defaultSpecTexture = "Interface\\Icons\\Ability_Marksmanship",
  19.     },
  20. };
__________________


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
09-20-22, 04:04 PM   #5
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
OK, but it does not show me how to enumerate the talents. Or how to look for a particular talent to be there or not, or what rank. That is all I need.

I have tried going down the C_Traits route but all I got is some nodes and the spell IDs are for Paladins (I am BM hunter). C_Traits is very confusing with a lot of unknown terminology.

Any ideas?
  Reply With Quote
09-20-22, 05:03 PM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Unfortunately not, most of the code is basing source data from the talent frame being open itself. So, whether or not there is a way to access that level of information without the frame being available I don't know.

This file mentions the Trait stuff in case you hadn't tracked it down yet :

https://github.com/Gethe/wow-ui-sour...TalentUtil.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
  Reply With Quote
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,929
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
09-21-22, 10:42 AM   #8
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
I have used the traits functions and it works (to tell me what traits you have and at what rank)

Basically you go:

Code:
  local lConfigID = C_ClassTalents.GetActiveConfigID();
  local lConfigInfo = C_Traits.GetConfigInfo(lConfigID);
  local lTreeIDs = lConfigInfo["treeIDs"];
  for i = 1, #lTreeIDs do
    for _, lNodeID in pairs(C_Traits.GetTreeNodes(lTreeIDs[i])) do
      local lNodeInfo = C_Traits.GetNodeInfo(lConfigID, lNodeID);
      local activeEntry = lNodeInfo.activeEntry;
      local activeRank = lNodeInfo.activeRank;
      if ( activeEntry and activeRank > 0 ) then
        local activeEntryID = activeEntry.entryID;
        local lEntryInfo = C_Traits.GetEntryInfo(lConfigID,activeEntryID);
        --if ( lEntryInfo ) then
          local lDefinitionID = lEntryInfo["definitionID"];
          --BA_Data["function LogTextLine"](string.format("def ID:%s",tostring(lDefinitionID)));
          local lDefinitionInfo = C_Traits.GetDefinitionInfo(lDefinitionID);
          --BA_Data["function LogTextLine"](string.format("def info:%s",tostring(lDefinitionInfo)));
          local spellID = lDefinitionInfo["spellID"];
          local spellName = GetSpellInfo(spellID);
          lTalents[spellName] = activeRank;
  Reply With Quote
09-21-22, 12:18 PM   #9
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Ah cool, I always got nil for configIDs so thought it was needing something else to work
__________________


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

WoWInterface » Developer Discussions » Lua/XML Help » Patch 10 - new API?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off