Removed all references to GetReagentsForSkill().
pschifferer [02-20-09 - 02:54]
Removed all references to GetReagentsForSkill().
diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua
index dadc5b0..cee4aba 100644
--- a/CauldronMainUI.lua
+++ b/CauldronMainUI.lua
@@ -374,7 +374,7 @@ function Cauldron:UpdateSkillList()
_G["CauldronSkillItem"..i.."Reagents"]:SetScale(0.86);
-- get reagents table
- local reagents = self:GetReagentsForSkill(skillInfo);
+ local reagents = skillInfo.reagents;
local reagentCount = #reagents;
for j=1,8 do
diff --git a/CauldronTradeskill.lua b/CauldronTradeskill.lua
index 3de9107..8901269 100644
--- a/CauldronTradeskill.lua
+++ b/CauldronTradeskill.lua
@@ -134,14 +134,31 @@ function Cauldron:UpdateSkills()
end
-- populate the reagent list
- Cauldron:GetReagentsForSkill(skillDB.recipes[name]);
+ for j=1,GetTradeSkillNumReagents(i) do
+ local rName, rIcon, rCount, _ = GetTradeSkillReagentInfo(i, j);
+ local rLink = GetTradeSkillReagentItemLink(i, j);
+ local rItemId = Cauldron:GetIdFromLink(rLink);
+ local value, set = self.libs.PT:ItemInSet(rItemId, "Tradeskill.Mat.BySource.Vendor");
+ local key = true;
+ if value then
+ key = false;
+ end
+
+ local r = {
+ ["name"] = rName,
+ ["numRequired"] = rCount,
+ ["skillIndex"] = i,
+ ["icon"] = rIcon,
+ ["link"] = rLink,
+ ["key"] = key,
+ };
+
+ table.insert(skillDB.recipes[name].reagents, r);
- -- update the keyword list for reagents
- for _,name in ipairs(skillDB.recipes[name].reagents) do
- keywords = keywords..","..name;
+ keywords = keywords..","..rname;
end
-
- -- fill in the db entry
+
+ -- fill in the keywords db entry
skillDB.recipes[name].keywords = keywords;
end
else
@@ -464,7 +481,7 @@ function Cauldron:GetRequiredItems(skillInfo, amount)
amount = math.max(1, tonumber(amount) or 1);
-- find out what the reagents are
- for i, reagent in ipairs(Cauldron:GetReagentsForSkill(skillInfo)) do
+ for i, reagent in ipairs(skillInfo.reagents) do
-- copy the reagent info so we can modify the amounts
local r = CopyTable(reagent);
@@ -494,6 +511,7 @@ local function split(sep, str)
return result;
end
+--[==[
function Cauldron:GetReagentsForSkill(skillInfo)
if not skillInfo then
@@ -587,3 +605,4 @@ function Cauldron:GetReagentsForSkill(skillInfo)
return reagents;
end
+--]==]
\ No newline at end of file