Aufruf als
Conditions.hero_talent.listedSpec(spec)
Erfassen Sie die Abhängigkeit Conditions.hero_talent.listedSpec und rufen Sie sie dann unter diesem Namen auf. Ein Aufruf über den Namensraum übergibt kein self: Verwenden Sie einen Doppelpunkt-Aufruf oder übergeben Sie das Objekt selbst.
Was sie bewirkt
Returns the specialization ID when it is one of the player's own class's specializations, which are the only ones whose hero talent trees the game can list. Reads the class from UnitClass and the choices from Platform:GetClassSpecializationChoices.
Argumente
| Name | Typ | Was sie bewirkt |
|---|---|---|
spec | number | nil | Specialization ID of the rotation being edited. |
Rückgabewerte
| 1 | number | nil | The same ID when the player's class has it; nil otherwise, or when the class or the list cannot be read. |
|---|
Editionen
Integrierte Hilfsfunktionen werden auf jeder Edition registriert. Unterschiedlich ist die Spiel-API, die sie lesen; fehlt eine, weicht die Hilfsfunktion aus oder gibt nil mit einem Grund zurück.
- Auf dieser Edition nicht verfügbar (den Grund nennt der Tooltip)
- Nur, solange Blizzards Ersatz für veraltete Funktionen aktiv ist
| Spiel-API | |||||
|---|---|---|---|---|---|
UnitClass |
Geheime Werte (Retail und Forever)
Auf Retail und Forever übergibt das Spiel Addons geheime Werte. Diese Hilfsfunktion prüft, was sie liest (addon.Platform:CanReadValue), und gibt statt eines geheimen Werts, den sie nicht vergleichen kann, nil mit einem Grund wie restricted-value zurück. Behandeln Sie nil als nicht verfügbar, nicht als false.
Wie das Addon sie aufruft
- Heldentalentbaum (widget)
local listed = type(platform.GetHeroTreeChoices) == "function" and platform:GetHeroTreeChoices(listedSpec(spec))
Quelle
Conditions/hero_talent.lua, Zeile 54. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.
Conditions.hero_talent.listedSpec(spec)
local platform = addon.Platform
if type(spec) ~= "number" or type(platform.GetClassSpecializationChoices) ~= "function" then return nil end
local ok, _, _, classID = pcall(UnitClass, "player")
if not ok or not platform:CanReadValue(classID) then return nil end
for _, choice in ipairs(platform:GetClassSpecializationChoices(classID) or {}) do
if choice.id == spec then return spec end
end




