Referência › Referência de funções › Platform

Platform.spells.gcdRunning

dependência

Chame como

Platform.spells.gcdRunning(self, now)

Registre a dependência Platform.spells.gcdRunning 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

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

NomeTipoO que faz
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
nownumberEvaluation time in GetTime() seconds.

Retornos

1boolean | nilTrue when the global cooldown is running, false when it is not; nil when unavailable.
2string | nilReason when the result is nil.

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

Dependências

Código-fonte

Platform/spells.lua, linha 534. Somente leitura no jogo; Duplicar cria uma cópia editável.

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

Voltar para Referência de funções