Справочник › Справочник функций › Platform

Platform.spells.gcdRunning

зависимость

Как вызывать

Platform.spells.gcdRunning(self, now)

Запишите зависимость Platform.spells.gcdRunning и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.

Что делает

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.

Аргументы

ИмяТипЧто делает
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
nownumberEvaluation time in GetTime() seconds.

Возвращает

1boolean | nilTrue when the global cooldown is running, false when it is not; nil when unavailable.
2string | nilReason when the result is nil.

Издания

Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.

Не читает игровой API напрямую.

Как его вызывает аддон

Зависимости

Исходный код

Platform/spells.lua, строка 534. В игре только для чтения; «Дублировать» создаёт редактируемую копию.

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

Назад: Справочник функций