Reference › Function reference › Platform

Platform.glyphs.GetGlyphItemInfo

public

Call as

addon.Platform:GetGlyphItemInfo(itemID, classID)

Available directly through addon; no dependency is needed.

What it does

Classify a numeric item as a glyph for the requested class, using guarded native item metadata. Class is optional and defaults to the readable player class. This establishes item classification only, not equipped status or an item-to-glyph-spell ID mapping.

Arguments

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (implicit with colon calls).
itemIDnumberPositive integer glyph item ID stored by the condition; arrays, item-set keys and spell IDs are not item references.
classIDnumber | nilOptional positive class ID; nil queries the current player class under protection.

Returns

1table | nilReadable canonical itemID/classID/subClassID record when the item is a glyph for the requested class; nil for invalid or unavailable metadata.
2string | nilClassification, validation or availability reason for a nil result.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
UnitClassClassic EraTBC AnniversaryClassic progressionForeverRetail

Secret values (Retail and Forever)

On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.

How the addon calls it

  • Glyph (valid)
    return addon.Platform:GetGlyphItemInfo(value.item, unit_class_num) ~= nil

Dependencies

Source

Platform/glyphs.lua, line 26. Read only in game; Duplicate makes an editable copy.

Platform.glyphs.GetGlyphItemInfo(self, itemID, classID)
    if not self:CanReadValue(itemID) or not self:CanReadValue(classID) then return nil,'restricted-value' end
    if not integer(itemID,1) then return nil,'invalid-item' end
    if classID==nil then
        if type(UnitClass)~='function' then return nil,'missing-api' end
        local ok,tuple=pcall(function() return {UnitClass('player')} end)
        if not ok then return nil,'api-error' end
        classID=tuple[3]
        if not self:CanReadValue(classID) then return nil,'restricted-value' end
        if classID==nil then return nil,'class-data-unavailable' end
    end
    if not integer(classID,1) then return nil,'invalid-class' end
    local record,reason=self:GetItemInfoInstant(itemID)
    if not record then return nil,reason end
    if record.classID~=16 or record.subClassID~=classID then return nil,'invalid-glyph-item' end
    return record

Back to Function reference