Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

API C_TradeSkillUI.GetRecipeReagentInfo

From Wowpedia
Jump to: navigation, search

Returns the information for a reagent needed by a recipe.

reagentName, reagentTexture, reagentCount, playerReagentCount = C_TradeSkillUI.GetRecipeReagentInfo(recipeID, reagentIndex)

Arguments

recipeID 
Number - ID of the recipe to get reagent information for.
reagentIndex 
Number - The index of the reagent to get information about, between 1 and C_TradeSkillUI.GetRecipeNumReagents(recipeID).

Returns

reagentName 
String - The localized name for the reagent.
reagentTexture 
String - Path for the reagent's texture.
reagentCount 
Number - The required number of the reagent needed to make the recipe once.
playerReagentCount
Number - The amount of the reagent the character has.

Example

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;

Patch changes

See also