WoW:API GetGlyphSocketInfo: Difference between revisions
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__ | ||
Returns information on a glyph socket. | |||
enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo([[Glyph SocketID|SocketID]]); | |||
== Parameters == | == Parameters == | ||
=== Arguments === | === Arguments === | ||
:;SocketID : | :;[[Glyph SocketID|SocketID]] : Integer - Socket number. | ||
=== Returns === | === Returns === | ||
:; | :;enabled: Boolean - 1 if available. '''nil''' if locked. | ||
:;glyphType : | :;glyphType : Integer - GLYPHTYPE_MAJOR or GLYPHTYPE_MINOR (1 is Major, 2 is Minor) | ||
:; | :;glyphSpellID : Integer - '''SpellID''' of socketted glyph. '''nil''' if none. | ||
:;icon : String - icon | :;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.