Reference › Function reference › Conditions

Conditions.build.setLabel

dependency

Call as

Conditions.build.setLabel(id)

Record the dependency Conditions.build.setLabel, 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

Formats an item set ID for the SET_PIECES description: the set name with its ID when addon:GetItemSetName knows it, otherwise "item set N". Returns nil when id is not a positive whole number.

Arguments

NameTypeWhat it does
idanySaved item set ID.

Returns

1string | nilLocalized set label, or nil for an invalid ID.

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/build.lua, line 71. Read only in game; Duplicate makes an editable copy.

Conditions.build.setLabel(id)
    if not wholeNumber(id) then return nil end
    local name=addon.GetItemSetName and addon:GetItemSetName(id)
    if name then return string.format(L["%s (set %d)"], name, id) end
    return string.format(L["item set %d"], id)

Back to Function reference