Llamar como
Conditions.player_state.statePhrase(state)
Registra la dependencia Conditions.player_state.statePhrase y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.
Qué hace
The readable sentence for one Player State, such as "you are mounted", worded so a Not flips it to "you are not mounted".
Argumentos
| Nombre | Tipo | Qué hace |
|---|---|---|
state | string | nil | The saved state. |
Retornos
| 1 | string | nil | The localized sentence template, or nil for an unknown state. |
|---|
Ediciones
Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.
No lee directamente ninguna API del juego.
Cómo la llama el addon
- Estado del jugador (print)
return statePhrase(value.state) or string.format(L["you {{!are|are not}} %s"], L["<state>"])
Código fuente
Conditions/player_state.lua, línea 50. Solo lectura en el juego; Duplicar crea una copia editable.
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