Returns the information for a reagent needed by a recipe.
reagentName, reagentTexture, reagentCount, playerReagentCount = C_TradeSkillUI.GetRecipeReagentInfo(recipeID, reagentIndex)
- Number - ID of the recipe to get reagent information for.
- Number - The index of the reagent to get information about, between 1 and C_TradeSkillUI.GetRecipeNumReagents(recipeID).
- String - The localized name for the reagent.
- String - Path for the reagent's texture.
- Number - The required number of the reagent needed to make the recipe once.
- Number - The amount of the reagent the character has.
The following snippet counts the total number of reagents needed for a recipe:
local numReagents = C_TradeSkillUI.GetRecipeNumReagents(recipeID); local totalReagents = 0; for idx = 1, numReagents do local _, _, reagentCount, _ = C_TradeSkillUI.GetRecipeReagentInfo(recipeID, idx); totalReagents = totalReagents + reagentCount; end;