Référence › Référence des fonctions › Platform

Platform.spells.gcdRunning

dépendance

Appel

Platform.spells.gcdRunning(self, now)

Enregistrez la dépendance Platform.spells.gcdRunning, puis appelez-la sous ce nom. Un appel par espace de noms ne transmet pas self : utilisez un appel avec deux-points ou passez l'objet vous-même.

Ce qu'elle fait

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.

Arguments

NomTypeCe qu'elle fait
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
nownumberEvaluation time in GetTime() seconds.

Retours

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

Éditions

Les fonctions utilitaires intégrées sont enregistrées sur toutes les éditions. Ce qui diffère, c'est l'API du jeu qu'elles lisent ; quand l'une manque, la fonction utilitaire se rabat sur une alternative ou renvoie nil avec une raison.

Elle ne lit directement aucune API du jeu.

Comment l'addon l'appelle

Dépendances

Source

Platform/spells.lua, ligne 534. En lecture seule dans le jeu ; Dupliquer crée une copie modifiable.

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

Retour à Référence des fonctions