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

Platform.spells.flagReadiness

зависимость

Как вызывать

Platform.spells.flagReadiness(self, enabled, active, onGCD, now)

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

Что делает

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.

Аргументы

ИмяТипЧто делает
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.

Возвращает

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.

Издания

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

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

Секретные значения (Retail и Forever)

В Retail и Forever игра передаёт аддонам секретные значения. Этот помощник проверяет то, что читает (addon.Platform:CanReadValue), и вместо секретного значения, которое нельзя сравнить, возвращает nil с причиной, например restricted-value. Считайте nil недоступным значением, а не ложью.

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

Зависимости

Исходный код

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

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"

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