diff Modules/Scanner.lua @ 142:56f33abee1e3

Always making sure the mover window is not there and making the frame when all data is ready, rather than before checking if the confirmation should even appear.
author Zerotorescue
date Tue, 18 Jan 2011 23:00:18 +0100
parents 20d7d3d19f97
children 12a8ea5af671
line wrap: on
line diff
--- a/Modules/Scanner.lua	Tue Jan 18 22:59:16 2011 +0100
+++ b/Modules/Scanner.lua	Tue Jan 18 23:00:18 2011 +0100
@@ -12,14 +12,18 @@
 	mod:Pause();
 	Mover:BeginMove(currentLocation, mod.Unpause);
 	
-	InventoriumItemMover:Hide();
+	if InventoriumItemMover then
+		InventoriumItemMover:Hide();
+	end
 end
 
 local function OnMoveCancel()
 	Mover:ResetQueue();
 	currentLocation = nil;
 	
-	InventoriumItemMover:Hide();
+	if InventoriumItemMover then
+		InventoriumItemMover:Hide();
+	end
 end
 
 local function GetSmallCoinTextureString(coins)
@@ -36,6 +40,10 @@
 
 -- Refill moves window: refill form storage such as the bank, guild bank and mailbox
 local function UseStorageRefillST()
+	if not InventoriumItemMover then
+		addon:CreateMoverFrame();
+	end
+	
 	local frame = InventoriumItemMover; -- both for speed as code-consistency
 	
 	-- Scrolling table with a list of items to be moved
@@ -110,6 +118,10 @@
 
 -- Merchant restock window: restock from a merchant by buying items needed
 local function UseMerchantRestockST(totalCost)
+	if not InventoriumItemMover then
+		addon:CreateMoverFrame();
+	end
+	
 	local frame = InventoriumItemMover; -- both for speed as code-consistency
 	
 	-- Scrolling table with a list of items to be moved
@@ -403,10 +415,6 @@
 		else
 			local moves = Mover:GetMoves();
 			
-			if not InventoriumItemMover then
-				addon:CreateMoverFrame();
-			end
-			
 			-- This table is never copied, just referenced. It is the same for every row.
 			local columns;