WoW:API GetTalentInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
(Returns information about a specified talent in a specified tab.)
Line 1: Line 1:
Returns the name of a specified talent in a specified tab.  
Returns information about a specified talent in a specified tab.  


  ''nameTalent'' = GetTalentInfo( ''tabIndex'' , ''talentIndex'' );
  ''nameTalent'' , ''iconPath'' , ''iconX'' , ''iconY'' , ''currentRank'' , ''maxRank'' = GetTalentInfo( ''tabIndex'' , ''talentIndex'' );


----
----
Line 16: Line 16:


:;nameTalent : String - The name of the talent in that tab.
:;nameTalent : String - The name of the talent in that tab.
:;iconPath : String - The path to the icon of the talent.
:;iconX : Integer - The horizontal grid position of the talent icon in its talent pane tab.
:;iconY : Integer - The horizontal grid position of the talent icon in its talent pane tab.
:;currentRank : Integer - The current rank (currently assigned talent points) of the talent.
:;maxRank : Integer - The maximum rank (maximum number of talent points) of the talent.


----
----
;''Example''
;''Example''


  local i = 1
  local numTabs = GetNumTalentTabs();
while i <= GetNumTalentTabs() do
for t=1, numTabs do
local numTalents = GetNumTalents(i)
    DEFAULT_CHAT_FRAME:AddMessage(GetTalentTabInfo(t)..":");
        local t = 1
    local numTalents = GetNumTalents(t);
        DEFAULT_CHAT_FRAME:AddMessage(GetTabInfo(i))
    for i=1, numTalents do
        while t <= numTalents do  
        nameTalent, icon, iconx, icony, currRank, maxRank= GetTalentInfo(t,i);
            DEFAULT_CHAT_FRAME:AddMessage( t .. ' ' .. GetTalentInfo(i,t) .. ' ' )
        DEFAULT_CHAT_FRAME:AddMessage("- "..nameTalent..": "..currRank.."/"..maxRank);
        end
    end
        i = i+1
  end
  end


;''Results'' : Displays the tab name then the talentIndex number followed by the talents name for each talent in each tab.
;''Results'' : Displays the tab name then the talents name and current/maximum ranks for each talent in each tab.


----
----
{{Template:WoW API}}
{{Template:WoW API}}

Revision as of 14:24, 29 March 2005

Returns information about a specified talent in a specified tab.

nameTalent , iconPath , iconX , iconY , currentRank , maxRank = GetTalentInfo( tabIndex , talentIndex );

Arguments
tabIndex
Integer - Specifies which tab the talent is in.
talentIndex
Integer - Specifies which talent to return its name.

Note: The talentIndex is counted as if it where a tree meaning that the left most talent in the top most row is number 1 followed by the one immediate to the right is number 2, if there is no more talents to the right then it continues from the left most talent on the next row.


Returns
nameTalent
String - The name of the talent in that tab.
iconPath
String - The path to the icon of the talent.
iconX
Integer - The horizontal grid position of the talent icon in its talent pane tab.
iconY
Integer - The horizontal grid position of the talent icon in its talent pane tab.
currentRank
Integer - The current rank (currently assigned talent points) of the talent.
maxRank
Integer - The maximum rank (maximum number of talent points) of the talent.

Example
local numTabs = GetNumTalentTabs();
for t=1, numTabs do
    DEFAULT_CHAT_FRAME:AddMessage(GetTalentTabInfo(t)..":");
    local numTalents = GetNumTalents(t);
    for i=1, numTalents do
        nameTalent, icon, iconx, icony, currRank, maxRank= GetTalentInfo(t,i);
        DEFAULT_CHAT_FRAME:AddMessage("- "..nameTalent..": "..currRank.."/"..maxRank);
    end
end
Results
Displays the tab name then the talents name and current/maximum ranks for each talent in each tab.

Template:WoW API