WoW:API GetTradeSkillReagentInfo
Jump to navigation
Jump to search
Returns information on reagents for the specified trade skill.
local reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(tradeSkillRecipeId, reagentId);
- Arguments
- (Number tradeSkillRecipeId, Number reagentId)
- tradeSkillRecipeId
- The Id of the tradeskill recipe
- reagentId
- The Id of the reagent (from 1 to x, where x is the result of calling API GetTradeSkillNumReagents)
- Returns
- String reagentName, String reagentTexture, Integer reagentCount, Integer playerReagentCount
- reagentName
- The name of the reagent.
- reagentTexture
- The texture for the reagent's icon.
- reagentCount
- The quantity of this reagent required to make one of these items.
- playerReagentCount
- The quantity of this reagent in the player's inventory.
- Example
local numReagents = GetTradeSkillNumReagents(id); for i=1, numReagents, 1 do local reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(id, i); SetItemButtonTexture(reagent, reagentTexture); name:SetText(reagentName); -- Grayout items if ( playerReagentCount < reagentCount ) then SetItemButtonTextureVertexColor(reagent, 0.5, 0.5, 0.5); name:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b); creatable = nil; end; end;