Reference › Function reference › Conditions

Conditions.hero_talent.treeName

dependency

Call as

Conditions.hero_talent.treeName(id)

Record the dependency Conditions.hero_talent.treeName, 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

Names a hero talent tree: the game's own name for it when Platform:GetHeroTreeName can read one, else "hero talent tree" followed by the ID.

Arguments

NameTypeWhat it does
idnumberHero talent tree (subtree) ID.

Returns

1string | nilThe name, or nil when id is not a valid tree ID.

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

  • Hero Talent Tree (print)
    return string.format(L["your hero talent tree {{!is|is not}} %s"], Functions.presentation.nullable(treeName(value.subtree), L["<hero talent tree>"]))

Dependencies

Source

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

Conditions.hero_talent.treeName(id)
    if not validTree(id) then return nil end
    local platform = addon.Platform
    local name = type(platform.GetHeroTreeName) == "function" and platform:GetHeroTreeName(id)
    if name then return name end
    return string.format(L["hero talent tree %d"], id)

Back to Function reference