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
| Name | Type | What it does |
|---|---|---|
class | string | Class file token, such as "WARRIOR". |
Returns
| 1 | table | Map of specialization ID to its name, or to {text=name, icon=icon} when the platform supplies an icon. |
|---|---|---|
| 2 | number[] | 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
- Specialization (widget)
local choices, order = classChoices(v)
Dependencies
CLASS_IDS(builtin:Conditions/specialization.lua:CLASS_IDS)SPECS(builtin:Conditions/specialization.lua:SPECS)SPEC_ORDER(builtin:Conditions/specialization.lua:SPEC_ORDER)specName→Conditions.specialization.specName
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