diff Queue.lua @ 62:fee06221176f

Seperated the config from Core.lua. Many other code cleaning up for readability. Added local references for much used globals. Moved widgets to a different file for readability. Re-added global function for slash command handling since we do need it for our chat-hyperlinks. Fixed queueing to properly use the track at property of virtual groups. Fixed queueing to display the item id instead of the item link if the item link could not be loaded. Speed slider at the summary now has an interval of 1% down from 5% and rounds rather than ceils it?s value so 101% will become 100% rather than 105%. Now using the right stock properties at the summary. Added a help group to the config.
author Zerotorescue
date Wed, 22 Dec 2010 19:56:55 +0100
parents d903b0a151d3
children 2127ab01ed4a
line wrap: on
line diff
--- a/Queue.lua	Wed Dec 22 15:04:09 2010 +0100
+++ b/Queue.lua	Wed Dec 22 19:56:55 2010 +0100
@@ -1,8 +1,11 @@
 local addon = select(2, ...);
 local mod = addon:NewModule("Queue", "AceEvent-3.0", "AceTimer-3.0");
 
+local pairs = pairs;
+
 function mod:OnEnable()
 	-- Register our own slash commands
+	-- /im queue
 	addon:RegisterSlash(function()
 		mod:QueueAll();
 	end, { "q", "que", "queue" }, "|Hfunction:InventoriumCommandHandler:queue|h|cff00fff7/im queue|r|h (or /im q) - Queue all items found in the currently opened profession that are within the groups tracked at this current character.");
@@ -24,7 +27,7 @@
 	
 	-- Go through all groups
 	for groupName, values in pairs(addon.db.profile.groups) do
-		local trackAt = (values.trackAtCharacters or (values.trackAtCharacters == nil and addon.db.profile.defaults.trackAtCharacters));
+		local trackAt = addon:GetOptionByKey(groupName, "trackAtCharacters");
 		
 		if trackAt[playerName] then
 			self:QueueGroup(groupName);
@@ -51,7 +54,7 @@
 			if not temp[itemId] then
 				local itemLink = select(2, GetItemInfo(itemId));
 				
-				print("Couldn't queue " .. itemLink .. " (not part of this profession)");
+				print("Couldn't queue " .. (itemLink or itemId or "???") .. " (not part of this profession)");
 			end
 		end
 	end