Référence › Référence des fonctions › Platform

Platform.spells.flagReadiness

dépendance

Appel

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

Enregistrez la dépendance Platform.spells.flagReadiness, puis appelez-la sous ce nom. Un appel par espace de noms ne transmet pas self : utilisez un appel avec deux-points ou passez l'objet vous-même.

Ce qu'elle fait

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

NomTypeCe qu'elle fait
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.

Retours

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.

Éditions

Les fonctions utilitaires intégrées sont enregistrées sur toutes les éditions. Ce qui diffère, c'est l'API du jeu qu'elles lisent ; quand l'une manque, la fonction utilitaire se rabat sur une alternative ou renvoie nil avec une raison.

Elle ne lit directement aucune API du jeu.

Valeurs secrètes (Retail et Forever)

Sur Retail et Forever, le jeu transmet aux addons des valeurs secrètes. Cette fonction utilitaire vérifie ce qu'elle lit (addon.Platform:CanReadValue) et renvoie nil avec une raison telle que restricted-value au lieu d'une valeur secrète qu'elle ne peut pas comparer. Traitez nil comme indisponible, pas comme false.

Comment l'addon l'appelle

Dépendances

Source

Platform/spells.lua, ligne 556. En lecture seule dans le jeu ; Dupliquer crée une copie modifiable.

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"

Retour à Référence des fonctions