diff Scanner.lua @ 82:f885805da5d6

Added options to toggle the automatic refilling. This defaults to true. Normalized property amount names; a move has a ?num? that must be moved and a location has a ?count? indicating the amount of items at that slot. Target/source item verification should now be working properly for guilds. When ?bank? is included in the local item count, we will skip trying to auto refill from this.
author Zerotorescue
date Thu, 06 Jan 2011 10:48:56 +0100
parents 58617c7827fa
children
line wrap: on
line diff
--- a/Scanner.lua	Thu Jan 06 01:01:25 2011 +0100
+++ b/Scanner.lua	Thu Jan 06 10:48:56 2011 +0100
@@ -78,7 +78,7 @@
 				-- If there is actually an item in this slot
 				
 			local itemLink = GetGuildBankItemLink(tabId, slotId);
-			local itemId = itemLink and GetItemId(itemLink);
+			local itemId = itemLink and GetItemID(itemLink);
 			local itemCount = itemLink and select(2, GetGuildBankItemInfo(tabId, slotId));
 				
 			if itemLink and itemId and itemCount and itemCount > 0 then
@@ -99,7 +99,7 @@
 			slotId = (slotId - 1);
 		end
 	else
-		error("Invalid location provided for the local _GetItemCount. Must be Bank or Guild.");
+		error("Invalid location provided for CacheLocation. Must be Bank or Guild.");
 	end
 	
 	if not remember then
@@ -125,8 +125,9 @@
 	-- Go through all groups
 	for groupName, values in pairs(addon.db.profile.groups) do
 		local trackAt = addon:GetOptionByKey(groupName, "trackAtCharacters");
+		local localItemData = self:GetOptionByKey(groupName, "localItemData");
 		
-		if values.items and trackAt[playerName] then
+		if values.items and trackAt[playerName] and addon:GetOptionByKey(groupName, "autoRefill") and (location ~= addon.Locations.Bank or not localItemData or not localItemData["Bank"]) then
 			-- Is this character interested in this data?
 			
 			local minLocalStock = addon:GetOptionByKey(groupName, "minLocalStock");
@@ -167,6 +168,8 @@
 			timeout = 0,
 			whileDead = 1,
 			hideOnEscape = 1,
+			exclusive = 1,
+			enterClicksFirstButton = 1,
 		};
 		StaticPopup_Show("InventoriumRefill");
 	end