Chame como
Conditions.build.setLabel(id)
Registre a dependência Conditions.build.setLabel 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
Formats an item set ID for the SET_PIECES description: the set name with its ID when addon:GetItemSetName knows it, otherwise "item set N". Returns nil when id is not a positive whole number.
Argumentos
| Nome | Tipo | O que faz |
|---|---|---|
id | any | Saved item set ID. |
Retornos
| 1 | string | nil | Localized set label, or nil for an invalid ID. |
|---|
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
- Peças do conjunto equipadas (print)
set = Functions.presentation.nullable(setLabel(value.set), L["<item set>"]),
Dependências
wholeNumber→Conditions.build.wholeNumber
Código-fonte
Conditions/build.lua, linha 71. Somente leitura no jogo; Duplicar cria uma cópia editável.
Conditions.build.setLabel(id)
if not wholeNumber(id) then return nil end
local name=addon.GetItemSetName and addon:GetItemSetName(id)
if name then return string.format(L["%s (set %d)"], name, id) end
return string.format(L["item set %d"], id)