Referencia › Referencia de funciones › Platform

Platform.spells.flagReadiness

dependencia

Llamar como

Platform.spells.flagReadiness(self, enabled, active, onGCD, now)

Registra la dependencia Platform.spells.flagReadiness 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

Decides cooldown readiness from the never-secret flags when the cooldown times are hidden. Returns false when the cooldown is disabled, true when no cooldown is active, false when the active cooldown is known not to be the global cooldown or the global cooldown is known not to be running, and true when the active cooldown is the global cooldown; otherwise nil with a reason.

Argumentos

NombreTipoQué hace
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
enabledbooleanThe spell's isEnabled flag.
activebooleanThe spell's isActive flag.
onGCDboolean | nilThe spell's isOnGCD flag, when the client reports it.
nownumberEvaluation time in GetTime() seconds, used to test the global cooldown.

Retornos

1boolean | nilTrue when ready by the end of the global cooldown, false when not; nil when it cannot be decided.
2string | nilThe global cooldown reason, or restricted-value, when the result is nil.

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.

Valores secretos (Retail y Forever)

En Retail y Forever, el juego entrega a los addons valores secretos. Esta función auxiliar comprueba lo que lee (addon.Platform:CanReadValue) y, en lugar de un secreto que no puede comparar, devuelve nil con un motivo como restricted-value. Trata nil como no disponible, no como falso.

Cómo la llama el addon

Dependencias

Código fuente

Platform/spells.lua, línea 556. Solo lectura en el juego; Duplicar crea una copia editable.

Platform.spells.flagReadiness(self, enabled, active, onGCD, now)
    if not enabled then return false end
    if not active then return true end
    if onGCD==false then return false end
    local running,why=gcdRunning(self,now)
    if running==false then return false end
    if onGCD==true then return true end
    return nil,why or "restricted-value"

Volver a Referencia de funciones