WoW:API GetGlyphSocketInfo: Difference between revisions

Added glyphTooltipIndex to the example usage code and noted that it was added in 4.0.1
(→‎Examples: fixed code)
(Added glyphTooltipIndex to the example usage code and noted that it was added in 4.0.1)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Returns information on a glyph socket.
Returns information on a glyph socket.
  enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(socketID[, talentGroup]);
  enabled, glyphType, glyphTooltipIndex, glyphSpellID, icon = GetGlyphSocketInfo(socketID[, talentGroup]);


==Arguments==
==Arguments==
Line 9: Line 9:
== Returns ==
== Returns ==
;enabled: Boolean - 1 if available, nil if locked.
;enabled: Boolean - 1 if available, nil if locked.
;glyphType : Number - GLYPHTYPE_MAJOR (1) or GLYPHTYPE_MINOR (2)
;glyphType : Number - GLYPHTYPE_PRIME (0), GLYPHTYPE_MAJOR (1), or GLYPHTYPE_MINOR (2)
;glyphTooltipIndex : Number - Index to be used with GLYPH_SLOT_TOOLTIP#
;glyphSpellID : Number - spell ID of socketted glyph, nil if no glyph is socketed.
;glyphSpellID : Number - spell ID of socketted glyph, nil if no glyph is socketed.
;icon : String - Glyph rune texture path.
;icon : String - Glyph rune texture path.
Line 16: Line 17:
The following code scans all the glyph sockets and prints out the status of each one.
The following code scans all the glyph sockets and prints out the status of each one.
  for i = 1, NUM_GLYPH_SLOTS do
  for i = 1, NUM_GLYPH_SLOTS do
   local enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(i);
   local enabled, glyphType, glyphTooltipIndex, glyphSpellID, icon = GetGlyphSocketInfo(i);
   if ( enabled ) then
   if ( enabled ) then
   local link = [[API GetGlyphLink|GetGlyphLink]](i);-- Retrieves the Glyph's link ("" if no glyph in Socket);
   local link = [[API GetGlyphLink|GetGlyphLink]](i);-- Retrieves the Glyph's link ("" if no glyph in Socket);
Line 32: Line 33:
* {{api|GetSpellInfo}} can be used to translate glyphSpellID to a glyph name.
* {{api|GetSpellInfo}} can be used to translate glyphSpellID to a glyph name.
* The talentGroup argument was added in [[Patch 3.1]].
* The talentGroup argument was added in [[Patch 3.1]].
* The glyphTooltipIndex argument was added in [[Patch 4.0.1]].
Anonymous user