WoW:API GameTooltip SetSpell: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Move page script moved page API GameTooltip SetSpell to API GameTooltip SetSpell without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{widgetmethod}}
{{widgetmethod}}
Shows the tooltip for the specified spell.
Shows the tooltip for the specified spell.
  GameTooltip:SetSpell(spellId, spellbookTabNum);
  GameTooltip:SetSpell(spellBookId, bookType);
;''Arguments''
;''Arguments''
:(spellId, spellbookTabNum)
:
:;spellId: Number - the id of the spell on the tab
:;spellBookId: Number - the id of the spell on the tab from the spellbook - not the same as SpellId
:;spellbookTabNum: Number - the number of the spell's tab in the spellbook
:;bookType: String - Either BOOKTYPE_SPELL ("spell") or BOOKTYPE_PET ("pet").


;''Returns''
;''Returns''
:unknown
:unknown
== Examples ==
GameTooltip:SetSpell(46, BOOKTYPE_SPELL)
== Details ==
* Find the spellBookId as follows:
local i = 1
while true do
    local spell, rank = GetSpellName(i, BOOKTYPE_SPELL)
    if (not spell) then
      break
    end
    if (rank) then
      spell = spell.." ("..rank..")"
    end
    DEFAULT_CHAT_FRAME:AddMessage(i..": "..spell)
    i = i + 1
end
== Notes ==
This has been renamed to SetSpellBookItem in patch 4.0.1

Latest revision as of 04:45, 15 August 2023

Widget API ← GameTooltip < SetSpell

Shows the tooltip for the specified spell.

GameTooltip:SetSpell(spellBookId, bookType);
Arguments
spellBookId
Number - the id of the spell on the tab from the spellbook - not the same as SpellId
bookType
String - Either BOOKTYPE_SPELL ("spell") or BOOKTYPE_PET ("pet").
Returns
unknown

Examples[edit]

GameTooltip:SetSpell(46, BOOKTYPE_SPELL)

Details[edit]

  • Find the spellBookId as follows:
local i = 1
while true do
   local spell, rank = GetSpellName(i, BOOKTYPE_SPELL)
   if (not spell) then
      break
   end
   if (rank) then
      spell = spell.." ("..rank..")"
   end
   DEFAULT_CHAT_FRAME:AddMessage(i..": "..spell)
   i = i + 1
end

Notes[edit]

This has been renamed to SetSpellBookItem in patch 4.0.1