Quantcast

Made the queue all button consider potential craft amounts as well as normal amounts. The user

pschifferer [02-24-09 - 06:59]
Made the queue all button consider potential craft amounts as well as normal amounts.  The user
can also force it to use the potential amount by holding the shift key down when clicking the
button.
Filename
CauldronMain.lua
diff --git a/CauldronMain.lua b/CauldronMain.lua
index 4d9da63..2d817b1 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -453,12 +453,26 @@ function Cauldron:QueueAllTradeSkillItem()

 	if skillInfo then
 		local amount = skillInfo.available;
+		local potential = Cauldron:GetPotentialCraftCount(skillInfo);
+		local queueAmount = 0;
+
+		-- if regular amount > 0 ...
 		if amount > 0 then
-			CauldronQueue:AddItem(self.db.realm.userdata[self.vars.playername].queue, skillInfo, amount);
+			if (potential > 0) and IsShiftKeyDown() then
+				queueAmount = potential;
+			else
+				queueAmount = amount;
+			end
+		else
+			queueAmount = potential;
+		end
+
+		if queueAmount > 0 then
+			CauldronQueue:AddItem(self.db.realm.userdata[self.vars.playername].queue, skillInfo, queueAmount);

 			Cauldron:UpdateQueue();
 		else
-			-- TODO: notify player?
+			-- self:info("No amount to queue for "..skillInfo.name..".");
 		end
 	end