Referência › Referência de funções › Platform

Platform.glyphs.layout

dependência

Chame como

Platform.glyphs.layout(info)

Registre a dependência Platform.glyphs.layout e depois chame-a por esse nome. Uma chamada com namespace não passa self: use uma chamada com dois-pontos ou passe o objeto você mesmo.

O que faz

Maps client information to the position in the GetGlyphSocketInfo result that holds the glyph spell ID. It recognizes only progression-family Wrath (3.4.0-3.4.3), Cataclysm (4.4.0-4.4.2) and Mists (5.5.0-5.5.4) clients whose version string and interface number agree, returning 3 for Wrath and 4 for Cataclysm and Mists; every other client returns nil.

Argumentos

NomeTipoO que faz
infotableClient information from addon.Platform:GetClientInfo() (projectId, family, expansion, version, interface).

Retornos

1number | nilReturn position of the glyph spell ID, or nil for an unsupported client layout.

Edições

As funções auxiliares integradas são registradas em todas as edições. O que muda é a API do jogo que elas leem; quando uma está ausente, a função auxiliar recorre a uma alternativa ou retorna nil com um motivo.

Não lê nenhuma API do jogo diretamente.

Como o addon a chama

Código-fonte

Platform/glyphs.lua, linha 51. Somente leitura no jogo; Duplicar cria uma cópia editável.

Platform.glyphs.layout(info)
    local editions={
        [11]={expansion=2,prefix='3.4.',last=3,base=30400,position=3},
        [14]={expansion=3,prefix='4.4.',last=2,base=40400,position=4},
        [19]={expansion=4,prefix='5.5.',last=4,base=50500,position=4},
    }
    local edition=editions[info.projectId]
    if not edition or info.family~='progression' or info.expansion~=edition.expansion then return nil end
    for patch=0,edition.last do
        if info.version==edition.prefix..patch and info.interface==edition.base+patch then return edition.position end
    end

Voltar para Referência de funções