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
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
record | table | Cooldown record from C_Spell.GetSpellCooldown; any other type returns nothing. |
Returns
| 1 | boolean | nil | isEnabled, false while the cooldown is on hold. |
|---|---|---|
| 2 | boolean | nil | isActive, true while a cooldown (its own or the global one) is running. |
| 3 | boolean | nil | isOnGCD, 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
Platform.spells.GetSpellCooldownif why == "restricted-value" and not built then return nil, why, cooldownFlags(self, record) end
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