API C_TradeSkillUI.GetRecipeInfo

From Wowpedia
Jump to: navigation, search

Returns information for a recipe.

recipeInfo = C_TradeSkillUI.GetRecipeInfo(recipeID[, returnTable])

Arguments

recipeID
Number - The ID of the recipe to get information for.
returnTable
Table - Optional. The table to return the information in.

Returns

recipeInfo
Table - A table containing information for the recipe:
Key Type Description
categoryID Number ID of the category the recipe belongs to.
craftable Boolean Indicates if the recipe can be crafted.
difficulty String "trivial", "easy", "optimal", or "medium"
disabled Boolean Indicates if the recipe is disabled.
favorite Boolean Indicates if the recipe is marked as a favorite.
hiddenUnlessLearned Boolean Indicates if the recipe should be hidden if it has yet to be learned.
icon Number ID of the recipe's icon.
learned Boolean Indicates if the character has learned the recipe.
name String Name of the recipe.
nextRecipeID Number ID of next recipe in the list.
numAvailable Number The number that can be created with the available reagents.
numIndents Number Number of indents when displaying under categories.
numSkillUps Number The number of skillups from creating the recipe.
previousRecipeID Number ID of the previous recipe in the list.
recipeID Number ID of the recipe.
sourceType Number Source of the recipe.
type String Type of recipe
alternateVerb String Alternate verb used for the recipe (such as enchants, or engineering tinkers)

Example

The following snippet lists the names of all the recipes for the current trade skill:

local recipeIDs = C_TradeSkillUI.GetAllRecipeIDs();
local recipeInfo = {};
for idx = 1, #recipeIDs do
  C_TradeSkillUI.GetRecipeInfo(recipeIDs[idx], recipeInfo);
  print(recipeInfo.recipeID, recipeInfo.name);
end

Details

  • Using the optional 'returnTable' argument improves performance by not creating a new table for each call to the function. This is particularly useful when iterating over all the recipes for a trade skill.

Patch changes

See also