Llamar como
Conditions.hero_talent.treeName(id)
Registra la dependencia Conditions.hero_talent.treeName y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.
Qué hace
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.
Argumentos
| Nombre | Tipo | Qué hace |
|---|---|---|
id | number | Hero talent tree (subtree) ID. |
Retornos
| 1 | string | nil | The name, or nil when id is not a valid tree ID. |
|---|
Ediciones
Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.
No lee directamente ninguna API del juego.
Cómo la llama el addon
- Árbol de talentos de héroe (print)
return string.format(L["your hero talent tree {{!is|is not}} %s"], Functions.presentation.nullable(treeName(value.subtree), L["<hero talent tree>"]))
Dependencias
validTree→Conditions.hero_talent.validTree
Código fuente
Conditions/hero_talent.lua, línea 42. Solo lectura en el juego; Duplicar crea una copia editable.
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)