Referenz › Funktionsreferenz › Conditions

Conditions.specialization.classChoices

Abhängigkeit

Aufruf als

Conditions.specialization.classChoices(class)

Erfassen Sie die Abhängigkeit Conditions.specialization.classChoices 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

Builds the specialization choices for one class in the SPECIALIZATION editor. Prefers the platform's live list, with icons, and otherwise falls back to the addon's built-in specialization table.

Argumente

NameTypWas sie bewirkt
classstringClass file token, such as "WARRIOR".

Rückgabewerte

1tableMap of specialization ID to its name, or to {text=name, icon=icon} when the platform supplies an icon.
2number[]Specialization IDs in display order.

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.

Sie liest keine Spiel-API direkt.

Wie das Addon sie aufruft

Abhängigkeiten

Quelle

Conditions/specialization.lua, Zeile 176. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.

Conditions.specialization.classChoices(class)
    local choices,order={},{}
    local listed=CLASS_IDS[class] and addon.Platform.GetClassSpecializationChoices
        and addon.Platform:GetClassSpecializationChoices(CLASS_IDS[class])
    if listed and #listed>0 then
        for _,spec in ipairs(listed) do
            choices[spec.id]=spec.icon and {text=spec.name,icon=spec.icon} or spec.name
            order[#order+1]=spec.id
        end
        return choices,order
    end
    for _,id in ipairs(SPEC_ORDER) do
        if SPECS[id][1]==class then choices[id]=specName(id);order[#order+1]=id end
    end
    return choices,order

Zurück zu Funktionsreferenz