Fixes for have any/key reagent filter.
pschifferer [02-26-09 - 02:15]
Fixes for have any/key reagent filter.
diff --git a/CauldronMain.lua b/CauldronMain.lua
index a7586f2..cf644c4 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -759,10 +759,8 @@ function Cauldron:SetTradeSkillItem(tooltip, itemIndex, reagentIndex)
local reagentInfo = Cauldron:GetReagentInfoByIndex(itemIndex, reagentIndex);
-- let the user know if the reagent is a "non-key" reagent
- if reagentInfo.key then
- tooltip:AddLine(L["Type: "].."|cff990000"..L["Key"].."|r");
- else
- tooltip:AddLine(L["Type: "].."|cffffffff"..L["Vendor"].."|r");
+ if not reagentInfo.key then
+ tooltip:AddLine("|cff444444"..L["Available at vendor"].."|r");
end
else
-- link = GetTradeSkillItemLink(itemIndex);
diff --git a/CauldronTradeskill.lua b/CauldronTradeskill.lua
index 9fcc89d..352b753 100644
--- a/CauldronTradeskill.lua
+++ b/CauldronTradeskill.lua
@@ -333,18 +333,24 @@ function Cauldron:GetSkillList(playername, skillName)
end
elseif self.db.realm.userdata[playername].skills[skillName].window.filter.haveKeyReagents then
-- check if the reagent count for key reagents is 0
+self:info("have key reagents: "..recipe.name);
for rname, rinfo in pairs(recipe.reagents) do
-- check possession count
- if (GetItemCount(rname) == 0) and (rinfo.key) then
+self:info("(have key) rname: "..rname.."; key: "..rinfo.key.."; count: "..GetItemCount(rinfo.link, false));
+ if (GetItemCount(rinfo.link, false) == 0) and (rinfo.key) then
+self:info("(have key) setting add to false");
add = false;
end
end
elseif self.db.realm.userdata[playername].skills[skillName].window.filter.haveAnyReagents then
-- check if the reagent count for any reagent is > 0
+self:info("have any reagents: "..recipe.name);
add = false;
for rname, rinfo in pairs(recipe.reagents) do
-- check possession count
- if GetItemCount(rname) > 0 then
+self:info("(have any) rname: "..rname.."; key: "..rinfo.key.."; count: "..GetItemCount(rinfo.link, false));
+ if GetItemCount(rinfo.link, false) > 0 then
+self:info("(have any) setting add to true");
add = true;
end
end
diff --git a/Locale/Cauldron-enUS.lua b/Locale/Cauldron-enUS.lua
index 993e8ff..7dcaa09 100644
--- a/Locale/Cauldron-enUS.lua
+++ b/Locale/Cauldron-enUS.lua
@@ -105,9 +105,7 @@ L["Decrease the amount of this item"] = true
L["Remove this item from the shopping list"] = true
-L["Type: "] = true
-L["Vendor"] = true
-L["Key"] = true
+L["Available at vendor"] = true
-- error messages
L["Crafting %1$s requires the %2$s skill."] = true