comparison Queue.lua @ 36:58fb38f0b447

The list of possible commands when you write /im without any arguement will now include commands inserted by modules with their own descriptions. Clicking a command in this list will now execute it. The slash command handler function is now a global so you can invoke these through other methods. Added an optional event function to registering auction pricing addons, when defined this will be executed when the pricing addon gets selected. Removed the unused ?Override local item data? option. Added ?AuctionProfitMaster? and ?ZeroAuctions? pricing support. The pricing info displayed in the summary window will be used for this. Trying to queue without any items in the summary should no longer give an error.
author Zerotorescue
date Sat, 20 Nov 2010 17:24:16 +0100
parents e732843b16d2
children d903b0a151d3
comparison
equal deleted inserted replaced
35:31e5da6a2b16 36:58fb38f0b447
2 local mod = addon:NewModule("Queue", "AceEvent-3.0", "AceTimer-3.0"); 2 local mod = addon:NewModule("Queue", "AceEvent-3.0", "AceTimer-3.0");
3 3
4 function mod:OnEnable() 4 function mod:OnEnable()
5 -- Register our own slash commands 5 -- Register our own slash commands
6 addon:RegisterSlash(function() 6 addon:RegisterSlash(function()
7 self:QueueAll(); 7 mod:QueueAll();
8 end, "q", "que", "queue"); 8 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.");
9 9
10 self:RegisterMessage("IM_QUEUE_ALL"); 10 self:RegisterMessage("IM_QUEUE_ALL");
11 self:RegisterMessage("IM_QUEUE_GROUP"); 11 self:RegisterMessage("IM_QUEUE_GROUP");
12 end 12 end
13 13
43 -- Go through all trade skills for the profession 43 -- Go through all trade skills for the profession
44 for i = 1, GetNumTradeSkills() do 44 for i = 1, GetNumTradeSkills() do
45 -- Process every single tradeskill 45 -- Process every single tradeskill
46 self:ProcessTradeSkill(i, groupName, temp); 46 self:ProcessTradeSkill(i, groupName, temp);
47 end 47 end
48 48
49 for itemId, _ in pairs(addon.db.global.groups[groupName].items) do 49 if addon.db.global.groups[groupName].items then
50 if not temp[itemId] then 50 for itemId, _ in pairs(addon.db.global.groups[groupName].items) do
51 local itemLink = select(2, GetItemInfo(itemId)); 51 if not temp[itemId] then
52 print("Couldn't queue " .. itemLink .. " (not part of this profession)"); 52 local itemLink = select(2, GetItemInfo(itemId));
53
54 print("Couldn't queue " .. itemLink .. " (not part of this profession)");
55 end
53 end 56 end
54 end 57 end
55 end 58 end
56 59
57 function mod:ProcessTradeSkill(i, groupName, temp) 60 function mod:ProcessTradeSkill(i, groupName, temp)