WoW API: GetGlyphSocketInfo

From AddOn Studio
Revision as of 23:55, 4 December 2008 by WoWWiki>Sdphantom (Updated with new information)
Jump to navigation Jump to search

WoW API < GetGlyphSocketInfo

Returns information on a glyph socket.

enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(SocketID);

Parameters

Arguments

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 GetSpellInfo)

Examples

The following code scans all the glyph sockets and prints out the status of each one.

for i = 1, NUM_GLYPH_SLOTS do
 local enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(i);
 if ( enabled ) then
  local link = GetGlyphLink(i);-- Retrieves the Glyph's link (nil of no glyph in Socket);
  if ( link ) then
   DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." contains "..link);
  else
   DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." is unlocked and empty!");
  end
 else
  DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." is locked!");
 end
end

Notes

"AddOns/Blizzard_GlyphUI/Blizzard_GlyphUI.lua" Passes glyphSpellID to GetSpellInfo to retrieve the glyph name.