Aufruf als
Conditions.talent.classSpecs()
Erfassen Sie die Abhängigkeit Conditions.talent.classSpecs 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
Lists the specializations of the player's class for the Talent condition's Specialization picker, so a rotation can pick the talents of a specialization other than the one being played. Only the Retail client has more than one talent tree per class; everywhere else, and when the class cannot be read, it returns nil and the picker is not shown.
Argumente
Keine.
Rückgabewerte
| 1 | table | nil | The class's specialization choices (id, name, icon), or nil where there is nothing to choose. |
|---|
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
Conditions.talent.traitsWidgetlocal specs=classSpecs()
Abhängigkeiten
platform(builtin:Conditions/talent.lua:platform)
Quelle
Conditions/talent.lua, Zeile 282. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.
Conditions.talent.classSpecs()
if platform:GetClientFamily()~="retail" or not platform.GetClassSpecializationChoices then return nil end
local ok,_,_,classID=pcall(UnitClass,"player")
if not ok or not platform:CanReadValue(classID) then return nil end
local choices=platform:GetClassSpecializationChoices(classID)
return choices and #choices>1 and choices or nil




