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...)
 
m (Move page script moved page API GetGlyphSocketInfo to API GetGlyphSocketInfo without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Return information about a glyph
Returns information on a glyph socket.
enabled, glyphType, glyphTooltipIndex, glyphSpellID, icon = GetGlyphSocketInfo(socketID[, talentGroup]);


unlocked, glyphType, glyphID, icon = GetGlyphSocketInfo(SocketID);
==Arguments==
== Parameters ==
;socketID : Number - glyph [Glyph SocketID|socket index]] (1 to GetNumGlyphSockets() )
=== Arguments ===
;talentGroup : Optional Number - (dual) specialization index (1 to {{api|GetNumTalentGroups}}(...)).
:;SocketID : Numeric - The socket index.
 
=== 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 : Number - GLYPHTYPE_PRIME (0), GLYPHTYPE_MAJOR (1), or GLYPHTYPE_MINOR (2)
:;glyphID : Numeric - Unique IDnil if the socket has no glyph
;glyphTooltipIndex : Number - Index to be used with GLYPH_SLOT_TOOLTIP#
:;icon : String - icon file directorynil if the socket has no glyph
;glyphSpellID : Number - spell ID of socketted glyph, nil if no glyph is socketed.
;icon : String - Glyph rune texture path.
 
== 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, glyphTooltipIndex, glyphSpellID, icon = GetGlyphSocketInfo(i);
  if ( enabled ) then
  local link = [[API GetGlyphLink|GetGlyphLink]](i);-- Retrieves the Glyph's link ("" if 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 ==
* {{api|GetSpellInfo}} can be used to translate glyphSpellID to a glyph name.
* The talentGroup argument was added in [[Patch 3.1]].
* The glyphTooltipIndex argument was added in [[Patch 4.0.1]].

Latest revision as of 04:45, 15 August 2023

WoW API < GetGlyphSocketInfo

Returns information on a glyph socket.

enabled, glyphType, glyphTooltipIndex, glyphSpellID, icon = GetGlyphSocketInfo(socketID[, talentGroup]);

Arguments[edit]

socketID
Number - glyph [Glyph SocketID|socket index]] (1 to GetNumGlyphSockets() )
talentGroup
Optional Number - (dual) specialization index (1 to GetNumTalentGroups(...)).

Returns[edit]

enabled
Boolean - 1 if available, nil if locked.
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.
icon
String - Glyph rune texture path.

Examples[edit]

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, glyphTooltipIndex, glyphSpellID, icon = GetGlyphSocketInfo(i);
 if ( enabled ) then
  local link = GetGlyphLink(i);-- Retrieves the Glyph's link ("" if 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[edit]

  • GetSpellInfo can be used to translate glyphSpellID to a glyph name.
  • The talentGroup argument was added in Patch 3.1.
  • The glyphTooltipIndex argument was added in Patch 4.0.1.