Chame como
Conditions.player_state.statePhrase(state)
Registre a dependência Conditions.player_state.statePhrase 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
The readable sentence for one Player State, such as "you are mounted", worded so a Not flips it to "you are not mounted".
Argumentos
| Nome | Tipo | O que faz |
|---|---|---|
state | string | nil | The saved state. |
Retornos
| 1 | string | nil | The localized sentence template, or nil for an unknown state. |
|---|
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
- Estado do jogador (print)
return statePhrase(value.state) or string.format(L["you {{!are|are not}} %s"], L["<state>"])
Código-fonte
Conditions/player_state.lua, linha 50. Somente leitura no jogo; Duplicar cria uma cópia editável.
Conditions.player_state.statePhrase(state)
if state == "mounted" then return L["you {{!are|are not}} mounted"]
elseif state == "swimming" then return L["you {{!are|are not}} swimming"]
elseif state == "flying" then return L["you {{!are|are not}} flying"]
elseif state == "falling" then return L["you {{!are|are not}} falling"]
elseif state == "resting" then return L["you {{!are|are not}} in a rested area"]
elseif state == "dead" then return L["you {{!are|are not}} dead"]
elseif state == "ghost" then return L["you {{!are|are not}} a ghost"] end