WoW:API GetSpellTabInfo: Difference between revisions

no edit summary
m (cat)
No edit summary
Line 1: Line 1:
<center>'''GetSpellTabInfo''' ''-Documentation by Lorrick-''</center>
{{wowapi}} __NOTOC__


Returns information about the specified spellbook tab.


name, texture, offset, numSpells = GetSpellTabInfo({spellbookTabNum});
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
Retrieves information about the specified line of spells
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
{{Code/Begin}}
name, texture, offset, numSpells = GetSpellTabInfo(spellbookTabNum)
{{Code/End}}


----
;''Arguments''


:( spellbookTabNum )
== Parameters ==


:;spellbookTab : Integer - Spellbook tab to retrieve information for. Valid values are 1 through MAX_SKILLLINE_TABS(8).
<big>'''Arguments'''</big>
<!-- List each argument, together with its type -->
:;spellbookTabNum  : Number - The index of the tab, ranges from 1 to MAX_SKILLLINE_TABS


----
;''Returns''


:<small>Not too familiar with LUA terminology yet so bear with me. Returns 4 values that I could tell.</small>
<big>'''Returns'''</big>
:name, texture, offset, numSpells
<!-- List each return value, together with its type -->
:;name : String - Spellbook Tab Name
:name, texture, offset, numSpells <!-- remove this line if it's just one value -->
:;texture : String - Spellbook Tab Texture
:;offset : Number - Spellbook Tab Offset
:;numSpells : Number - Number of spells for this tab.


----
:;name : String - The name of the spell line (General, Shadow, Fury, etc.)
;''Example''
:;texture : String - The texture path for the spell line's icon
name, texture, offset, numSpells = GetSpellTabInfo(1);
:;offset : Number - The number of spells before this spell line (will be one less than the index of the first spell in this spell line)
:;numSpells : Number - The number of spells in this spell line


;''Result''
== Example ==
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
for i = 1, MAX_SKILLLINE_TABS do
    local name, texture, offset, numSpells = GetSpellTabInfo(i);
   
    if not name then
      break;
    end
   
    for s = offset + 1, offset + numSpells do
      local spell, rank = GetSpellName(s, BOOKTYPE_SPELL);
     
      if rank then
          spell = spell.." "..rank;
      end
     
      DEFAULT_CHAT_FRAME:AddMessage(name..": "..spell);
    end
end


----
[[Category:World of Warcraft API]]
;''Description''
 
: Retreive information for specified spellbook tab.
----
{{Template:WoW API}}
Anonymous user