WoW:API GetGlyphSocketInfo: Difference between revisions

formatting, 3.1
(Updated with new information)
(formatting, 3.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]);
==Arguments==
;socketID : Number - glyph [Glyph SocketID|socket index]] (1 to GetNumGlyphSockets() )
;talentGroup : Optional Number - (dual) specialization index (1 to {{api|GetNumTalentGroups}}(...)).
== Returns ==
;enabled: Boolean - 1 if available, nil if locked.
;glyphType : Number - GLYPHTYPE_MAJOR (1) or GLYPHTYPE_MINOR (2)
;glyphSpellID : Number - spell ID of socketted glyph, nil if no glyph is socketed.
;icon : String - Glyph rune texture path.


enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo([[Glyph SocketID|SocketID]]);
== Parameters ==
=== Arguments ===
:;[[Glyph SocketID|SocketID]] : Integer - Socket number.
=== Returns ===
:;enabled: Boolean - 1 if available. '''nil''' if locked.
:;glyphType : Integer - GLYPHTYPE_MAJOR or GLYPHTYPE_MINOR (1 is Major, 2 is Minor)
:;glyphSpellID : Integer - '''SpellID''' of socketted glyph. '''nil''' if none.
:;icon : String - Rune icon path. (Not the same icon as returned by [[API GetSpellInfo | GetSpellInfo]])
== Examples ==
== Examples ==
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.
Line 26: Line 28:
   end
   end
  end
  end
== Notes ==
== Notes ==
"AddOns/Blizzard_GlyphUI/Blizzard_GlyphUI.lua"
* {{api|GetSpellInfo}} can be used to translate glyphSpellID to a glyph name.
Passes '''glyphSpellID''' to [[API GetSpellInfo | GetSpellInfo]] to retrieve the glyph name.
* The talentGroup argument was added in [[Patch 3.1]].