diff Queue.lua @ 23:7d7aaa3fbe94

If Auctioneer data can not be retrieved, it will now display as ?Error? rather than break the caching. The premade group update check should now be fully functional. You can now shift-click item links into other text fields and alt-click while the auction house window is open to search it. Added an option to the config to select the data used for the local item data. This option currently does nothing and is just a placeholder (just like the ?alert when below threshold? option). Removed useless pullout hiding code for the track at characters option. Added an option to always show the auction value, even when the threshold is nil. When overriding an option, the default value should now be copied into the group, even without you changing it back and forth (previously if you overridden an option and didn?t change the value, it would still use the default value). The ?Stock settings? tab is now called the ?General? tab. The ?Group Management? tab is now called ?Management? tab. Added tooltip descriptions to the ?Add items? and ?Current items? tabs. Added the option to override the preferred addons to individual groups. No longer copying tables when making the groups list in the config. We can just reference it (saves quite some memory). Bumped the interface version from 30300 to 40000. Added slash command arguement ?reset? (or the short version ?r?) to reset the size of the summary frame (I messed mine up while making some screenshots /facepalm). You can now close the summary frame with escape.
author Zerotorescue
date Thu, 28 Oct 2010 19:14:30 +0200
parents 8f5c02113c5c
children e732843b16d2
line wrap: on
line diff
--- a/Queue.lua	Wed Oct 20 01:37:22 2010 +0200
+++ b/Queue.lua	Thu Oct 28 19:14:30 2010 +0200
@@ -75,7 +75,7 @@
 				temp[itemId] = true;
 			end
 			
-			local currentStock = addon:GetItemCount(itemId);
+			local currentStock = addon:GetItemCount(itemId, groupName);
 			if currentStock >= 0 then
 				-- Current stock will be -1 when no itemcount addon was found
 				local restockTarget = addon:GetOptionByKey(groupName, "restockTarget");
@@ -89,7 +89,7 @@
 				end
 				
 				if amount > 0 and amount >= minCraftingQueue then
-					self:Queue(i, amount);
+					self:Queue(i, amount, groupName);
 					
 					print("Queued " .. amount .. " of " .. itemLink);
 				end
@@ -100,16 +100,18 @@
 	end
 end
 
-function mod:Queue(tradeSkillIndex, amount)
+function mod:Queue(tradeSkillIndex, amount, group)
 	tradeSkillIndex = tonumber(tradeSkillIndex);
 	amount = tonumber(amount);
 	
 	if not tradeSkillIndex or not amount then return; end
 	
-	if addon.supportedAddons.crafting[addon.db.global.defaults.craftingAddon] then
+	local selectedExternalAddon = addon:GetOptionByKey(group, "craftingAddon");
+	
+	if addon.supportedAddons.crafting[selectedExternalAddon] and addon.supportedAddons.crafting[selectedExternalAddon].IsEnabled() then
 		-- Try to use the default auction pricing addon
 		
-		return addon.supportedAddons.crafting[addon.db.global.defaults.craftingAddon].Queue(tradeSkillIndex, amount);
+		return addon.supportedAddons.crafting[selectedExternalAddon].Queue(tradeSkillIndex, amount);
 	else
 		-- Default not available, get the first one then