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
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
now | number | Evaluation time in GetTime() seconds. |
Returns
| 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. |
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
Platform.spells.flagReadinesslocal running,why=gcdRunning(self,now)
Dependencies
cooldownValues→Platform.spells.cooldownValuesgcdSpell(builtin:Platform/spells.lua:gcdSpell)
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