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

Conditions.talent.integer

dependência

Chame como

Conditions.talent.integer(value, minimum, maximum)

Registre a dependência Conditions.talent.integer 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

True when value is a whole number between minimum and maximum, inclusive.

Argumentos

NomeTipoO que faz
valueanyValue to check.
minimumnumberSmallest accepted value.
maximumnumberLargest accepted value.

Retornos

1booleanTrue when the value passes the check.

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

  • Árvore de talentos principal (valid)
    return integer(value.tree,1,16)
  • Talento (valid)
    return integer(value.node,1,2147483647) and (value.entry==nil or integer(value.entry,1,2147483647))
  • Pontos na árvore de talentos (evaluate)
    if not integer(tree.pointsSpent,0,512) then return nil,'talent-points-unavailable' end
  • Conditions.talent.gridWidget
    local chosen=value.layout=="grid" and integer(value.value,1,18) and value.value or nil
  • Conditions.talent.group
    if platform:GetClientInfo().family=="progression" and integer(spec,1,4) then return spec end
  • Conditions.talent.info
    if traitShape(value) then return integer(value.node,1,2147483647) and platform:GetTraitTalentIdentity(value.node,value.entry,value.spell) or nil end
  • Conditions.talent.legacySlot
    return value.layout==nil and value.tree==nil and value.talent==nil and integer(value.value,1,21)
  • Conditions.talent.treeName
    local name=integer(value.tree,1,16) and addon.TalentTrees.Name(value.tree,addon.TalentTrees.ContextClass(),group(spec))

Código-fonte

Conditions/talent.lua, linha 47. Somente leitura no jogo; Duplicar cria uma cópia editável.

Conditions.talent.integer(value, minimum, maximum)
    return type(value)=="number" and value>=minimum and value<=maximum and value%1==0

Voltar para Referência de funções