Call as
Platform.spells.flagReadiness(self, enabled, active, onGCD, now)
Record the dependency Platform.spells.flagReadiness, 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
Decides cooldown readiness from the never-secret flags when the cooldown times are hidden. Returns false when the cooldown is disabled, true when no cooldown is active, false when the active cooldown is known not to be the global cooldown or the global cooldown is known not to be running, and true when the active cooldown is the global cooldown; otherwise nil with a reason.
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
enabled | boolean | The spell's isEnabled flag. |
active | boolean | The spell's isActive flag. |
onGCD | boolean | nil | The spell's isOnGCD flag, when the client reports it. |
now | number | Evaluation time in GetTime() seconds, used to test the global cooldown. |
Returns
| 1 | boolean | nil | True when ready by the end of the global cooldown, false when not; nil when it cannot be decided. |
|---|---|---|
| 2 | string | nil | The global cooldown reason, or restricted-value, 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.
Secret values (Retail and Forever)
On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.
How the addon calls it
Platform.spells.IsSpellReadyreturn flagReadiness(self,enabled,active,onGCD,now)
Dependencies
gcdRunning→Platform.spells.gcdRunning
Source
Platform/spells.lua, line 556. Read only in game; Duplicate makes an editable copy.
Platform.spells.flagReadiness(self, enabled, active, onGCD, now)
if not enabled then return false end
if not active then return true end
if onGCD==false then return false end
local running,why=gcdRunning(self,now)
if running==false then return false end
if onGCD==true then return true end
return nil,why or "restricted-value"