Reference › Function reference › Conditions

Conditions.specialization.classChoices

dependency

Call as

Conditions.specialization.classChoices(class)

Record the dependency Conditions.specialization.classChoices, 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

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.

Arguments

NameTypeWhat it does
classstringClass file token, such as "WARRIOR".

Returns

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.

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

Dependencies

Source

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

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

Back to Function reference