Reference › Function reference › Conditions

Conditions.talent.integer

dependency

Call as

Conditions.talent.integer(value, minimum, maximum)

Record the dependency Conditions.talent.integer, 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

True when value is a whole number between minimum and maximum, inclusive.

Arguments

NameTypeWhat it does
valueanyValue to check.
minimumnumberSmallest accepted value.
maximumnumberLargest accepted value.

Returns

1booleanTrue when the value passes the check.

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.

How the addon calls it

  • Primary Talent Tree (valid)
    return integer(value.tree,1,16)
  • Talent (valid)
    return integer(value.node,1,2147483647) and (value.entry==nil or integer(value.entry,1,2147483647))
  • Talent Tree Points (evaluate)
    if not integer(tree.pointsSpent,0,512) then return nil,'talent-points-unavailable' end
  • Conditions.talent.gridWidget
    local chosen=value.layout=="grid" and integer(value.value,1,18) and value.value or nil
  • Conditions.talent.group
    if platform:GetClientInfo().family=="progression" and integer(spec,1,4) then return spec end
  • Conditions.talent.info
    if traitShape(value) then return integer(value.node,1,2147483647) and platform:GetTraitTalentIdentity(value.node,value.entry,value.spell) or nil end
  • Conditions.talent.legacySlot
    return value.layout==nil and value.tree==nil and value.talent==nil and integer(value.value,1,21)
  • Conditions.talent.treeName
    local name=integer(value.tree,1,16) and addon.TalentTrees.Name(value.tree,addon.TalentTrees.ContextClass(),group(spec))

Source

Conditions/talent.lua, line 47. Read only in game; Duplicate makes an editable copy.

Conditions.talent.integer(value, minimum, maximum)
    return type(value)=="number" and value>=minimum and value<=maximum and value%1==0

Back to Function reference