API GetGlyphInfo

From Warcraft Wiki
Jump to navigation Jump to search

Returns the information about glyphs

name, glyphType, isKnown, icon, glyphId, glyphLink, spec, specMatches, excluded = GetGlyphInfo(index)

Arguments

index
Number - Index of glyph as is shown in the glyph panel, ascending from 1.

Returns

name
String - The name of the glyph or "header" if a header
glyphType
Number - Type of the glyph (1 - Major, 2 - Minor)
isKnown
Boolean - True if the player has learned the glyph in question or a filter index if a header
icon
Texture for glyph button widget or nil if a header
glyphId
Number - the id of the glyph or nil if a header
glyphLink
String - the link of the selected glyph or nil if a header
spec
String - the specialization that the glyph is specific to or nil if applicable to all specializations
specMatches
Boolean - True if the glyph is usable in player's current specialization
excluded
Boolean - True if player is using another glyph that is exclusive with the glyph in question

Example

You can extract the link contents as follows:

 _,_,_,linkType,linkId,linkName = string.find(glyphLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+)|?h?%[?([^%[%]]*)%]?|?h?|?r?")

Convents this '|cff66bbff|Hglyph:272|h[Glyph of Incinerate]|h|r' to 66bbff, glyph, 272, Glyph of Incinerate

See also