WoW:API GetTradeSkillReagentInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Fixed category sort order)
 
(Chnaged the link)
Line 12: Line 12:


:;tradeSkillRecipeId : The Id of the tradeskill recipe
:;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]])
:;reagentId : The Id of the reagent (from 1 to x, where x is the result of calling [[API GetTradeSkillNumReagents|GetTradeSkillNumReagents]])


----
----

Revision as of 15:18, 23 March 2005

GetTradeSkillReagentInfo -Documentation by Goldark-

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 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;



Template:WoW API