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
| Name | Type | What it does |
|---|---|---|
id | any | Saved item set ID. |
Returns
| 1 | string | nil | Localized 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
- Item Set Pieces Equipped (print)
set = Functions.presentation.nullable(setLabel(value.set), L["<item set>"]),
Dependencies
wholeNumber→Conditions.build.wholeNumber
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)