WoW:API GetGlyphSocketInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(New page: {{wowapi}} __NOTOC__ Return information about a glpyh unlocked, glyphType, glyphID, icon = GetGlyphSocketInfo(SocketID); == Parameters == === Arguments === :;SocketID : Numeric - The soc...)
 
(Updated with new information)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Return information about a glyph
Returns information on a glyph socket.


  unlocked, glyphType, glyphID, icon = GetGlyphSocketInfo(SocketID);
  enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo([[Glyph SocketID|SocketID]]);
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
:;SocketID : Numeric - The socket index.
:;[[Glyph SocketID|SocketID]] : Integer - Socket number.
=== Returns ===
=== Returns ===
:;unlocked: Flag - 1 if the glyph is accessible. nil if the socket is locked
:;enabled: Boolean - 1 if available. '''nil''' if locked.
:;glyphType : Numeric - 1 for major glyph.  2 for minor glyph
:;glyphType : Integer - GLYPHTYPE_MAJOR or GLYPHTYPE_MINOR (1 is Major, 2 is Minor)
:;glyphID : Numeric - Unique ID. nil if the socket has no glyph
:;glyphSpellID : Integer - '''SpellID''' of socketted glyph. '''nil''' if none.
:;icon : String - icon file directory.  nil if the socket has no glyph
:;icon : String - Rune icon path. (Not the same icon as returned by [[API GetSpellInfo | 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 = [[API GetGlyphLink|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 [[API GetSpellInfo | GetSpellInfo]] to retrieve the glyph name.

Revision as of 23:55, 4 December 2008

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.