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
| Nom | Type | Ce qu'elle fait |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
now | number | Evaluation time in GetTime() seconds. |
Retours
| 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. |
É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
Platform.spells.flagReadinesslocal running,why=gcdRunning(self,now)
Dépendances
cooldownValues→Platform.spells.cooldownValuesgcdSpell(builtin:Platform/spells.lua:gcdSpell)
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