Reference › Function reference › Platform

Platform.spells.gcdRunning

dependency

Call as

Platform.spells.gcdRunning(self, now)

Record the dependency Platform.spells.gcdRunning, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

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

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
nownumberEvaluation time in GetTime() seconds.

Returns

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

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

How the addon calls it

Dependencies

Source

Platform/spells.lua, line 534. Read only in game; Duplicate makes an editable copy.

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

Back to Function reference