diff Modules/Mover.lua @ 101:6ae44d372360

The confirmation window when refilling from the (guild) bank is enabled can now be skipped at the general config. It defaults to false. Added a window displaying a list of movable items when at least one is available at the (guild) bank. Resetting the queue when closing the storage.
author Zerotorescue
date Tue, 11 Jan 2011 19:48:35 +0100
parents 252292b703ce
children 3bbad0429d87
line wrap: on
line diff
--- a/Modules/Mover.lua	Sun Jan 09 17:52:02 2011 +0100
+++ b/Modules/Mover.lua	Tue Jan 11 19:48:35 2011 +0100
@@ -6,10 +6,12 @@
 local combinedMoves = {}; -- table storing all combined moves (with source and target) that is to be processed by the actual mover in the order of the index (1 to #)
 local movesSource;
 
-function mod:AddMove(itemId, amount)
+function mod:AddMove(itemId, amount, numMissing, numAvailable)
 	table.insert(queuedMoves, {
 		id = itemId,
 		num = amount,
+		missing = numMissing,
+		available = numAvailable,
 	});
 end
 
@@ -17,6 +19,14 @@
 	return (#queuedMoves ~= 0);
 end
 
+function mod:GetMoves()
+	return queuedMoves;
+end
+
+function mod:ResetQueue()
+	table.wipe(queuedMoves);
+end
+
 if not table.reverse then
 	table.reverse = function(orig)
 		local temp = {};
@@ -49,7 +59,7 @@
 	for _, singleMove in pairs(queuedMoves) do
 		local sourceItem = sourceContents[singleMove.id];
 		if not sourceItem then
-			addon:Print("Can't move " .. IdToItemLink(singleMove.id) .. ", this doesn't exist in the source.", addon.Colors.Red);
+			addon:Print(("Can't move %s, this doesn't exist in the source."):format(IdToItemLink(singleMove.id)), addon.Colors.Red);
 		else
 			-- We want to move the smallest stacks first to keep stuff pretty (and minimize space usage, splitting a stack takes 2 slots, moving something only 1)
 			table.sort(sourceItem.locations, function(a, b)