Llamar como
Platform.spells.gcdRunning(self, now)
Registra la dependencia Platform.spells.gcdRunning 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
Reports whether the global cooldown is running at time now. It resolves the global cooldown spell through addon.Platform:GetGlobalCooldown() when needed, then uses the readable times (enabled, positive duration, expiry after now) or, when the times are secret, the isEnabled and isActive flags. Returns nil with a reason when neither is available.
Argumentos
| Nombre | Tipo | Qué hace |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
now | number | Evaluation time in GetTime() seconds. |
Retornos
| 1 | boolean | nil | True when the global cooldown is running, false when it is not; nil when unavailable. |
|---|---|---|
| 2 | string | nil | Reason 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.
Cómo la llama el addon
Platform.spells.flagReadinesslocal running,why=gcdRunning(self,now)
Dependencias
cooldownValues→Platform.spells.cooldownValuesgcdSpell(builtin:Platform/spells.lua:gcdSpell)
Código fuente
Platform/spells.lua, línea 534. Solo lectura en el juego; Duplicar crea una copia editable.
Platform.spells.gcdRunning(self, now)
if not gcdSpell then self:GetGlobalCooldown() end
local start,duration,enabled,why,active=cooldownValues(self,gcdSpell)
if start~=nil then return enabled and duration>0 and start+duration>now end
if active==nil then return nil,why end
return enabled and active