Chiamala come
Platform.spells.gcdRunning(self, now)
Registra la dipendenza Platform.spells.gcdRunning, poi chiamala con quel nome. Una chiamata con spazio dei nomi non passa self: usa una chiamata con i due punti o passa tu l'oggetto.
Cosa fa
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.
Argomenti
| Nome | Tipo | Cosa fa |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
now | number | Evaluation time in GetTime() seconds. |
Valori restituiti
| 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. |
Edizioni
Le funzioni di supporto integrate sono registrate su ogni edizione. Ciò che cambia è l'API di gioco che leggono; dove ne manca una, la funzione di supporto ripiega su un'alternativa o restituisce nil con un motivo.
Non legge direttamente alcuna API di gioco.
Come la chiama l'addon
Platform.spells.flagReadinesslocal running,why=gcdRunning(self,now)
Dipendenze
cooldownValues→Platform.spells.cooldownValuesgcdSpell(builtin:Platform/spells.lua:gcdSpell)
Sorgente
Platform/spells.lua, riga 534. Nel gioco è in sola lettura; Duplica crea una copia modificabile.
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