Referencia › Referencia de funciones › Platform

Platform.spells.cooldownFlags

dependencia

Llamar como

Platform.spells.cooldownFlags(self, record)

Registra la dependencia Platform.spells.cooldownFlags y después llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa el objeto tú mismo.

Qué hace

Extracts the never-secret isEnabled, isActive and isOnGCD flags from a C_Spell.GetSpellCooldown record whose times are secret. Returns all three when they are readable, isEnabled and isActive are Booleans and isOnGCD is a Boolean or nil; otherwise returns nothing.

Argumentos

NombreTipoQué hace
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
recordtableCooldown record from C_Spell.GetSpellCooldown; any other type returns nothing.

Retornos

1boolean | nilisEnabled, false while the cooldown is on hold.
2boolean | nilisActive, true while a cooldown (its own or the global one) is running.
3boolean | nilisOnGCD, true when the running cooldown is the global cooldown; may be 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 usa 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 les entrega a los addons valores secretos. Esta función auxiliar verifica 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

Código fuente

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

Platform.spells.cooldownFlags(self, record)
    if type(record) ~= "table" then return end
    local enabled, active, onGCD = record.isEnabled, record.isActive, record.isOnGCD
    if not self:CanReadValue(enabled) or not self:CanReadValue(active) or not self:CanReadValue(onGCD) then return end
    if type(enabled) ~= "boolean" or type(active) ~= "boolean" or (onGCD ~= nil and type(onGCD) ~= "boolean") then return end
    return enabled, active, onGCD

Volver a Referencia de funciones