Reference › Function reference › Conditions

Conditions.specialization.specName

dependency

Call as

Conditions.specialization.specName(id)

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

Names a specialization for SPECIALIZATION descriptions: the platform's display name and icon, else the built-in localized name, else "specialization N". Returns nil when id is not a valid specialization ID.

Arguments

NameTypeWhat it does
idanySaved specialization ID.

Returns

1string | nilSpecialization name, or nil for an invalid ID.
2number | string | nilIcon, only when the platform supplied display data.

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 152. Read only in game; Duplicate makes an editable copy.

Conditions.specialization.specName(id)
    if not specID(id) then return nil end
    local listed=SPECS[id]
    if listed and listed[3]=="Initial" then return L["No specialization"] end
    local display=addon.Platform.GetSpecializationDisplay and addon.Platform:GetSpecializationDisplay(id)
    if display then return display.name,display.icon end
    local known=SPECS[id]
    if known then return L[known[3]] end
    return string.format(L["specialization %d"],id)

Back to Function reference