Reference › Function reference › Platform

Platform.spells.flagReadiness

dependency

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

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
enabledbooleanThe spell's isEnabled flag.
activebooleanThe spell's isActive flag.
onGCDboolean | nilThe spell's isOnGCD flag, when the client reports it.
nownumberEvaluation time in GetTime() seconds, used to test the global cooldown.

Returns

1boolean | nilTrue when ready by the end of the global cooldown, false when not; nil when it cannot be decided.
2string | nilThe 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

Dependencies

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"

Back to Function reference