Reference › Function reference › Platform

Platform.spells.cooldownFlags

dependency

Call as

Platform.spells.cooldownFlags(self, record)

Record the dependency Platform.spells.cooldownFlags, 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

Extracts the never-secret isEnabled, isActive and isOnGCD flags from a C_Spell.GetSpellCooldown record whose times are secret. Returns all three when they are readable, isEnabled and isActive are Booleans and isOnGCD is a Boolean or nil; otherwise returns nothing.

Arguments

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
recordtableCooldown record from C_Spell.GetSpellCooldown; any other type returns nothing.

Returns

1boolean | nilisEnabled, false while the cooldown is on hold.
2boolean | nilisActive, true while a cooldown (its own or the global one) is running.
3boolean | nilisOnGCD, true when the running cooldown is the global cooldown; may be 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

Source

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

Platform.spells.cooldownFlags(self, record)
    if type(record) ~= "table" then return end
    local enabled, active, onGCD = record.isEnabled, record.isActive, record.isOnGCD
    if not self:CanReadValue(enabled) or not self:CanReadValue(active) or not self:CanReadValue(onGCD) then return end
    if type(enabled) ~= "boolean" or type(active) ~= "boolean" or (onGCD ~= nil and type(onGCD) ~= "boolean") then return end
    return enabled, active, onGCD

Back to Function reference