comparison Summary.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 9607b3251655
comparison
equal deleted inserted replaced
35:31e5da6a2b16 36:58fb38f0b447
15 15
16 -- Register our own slash commands 16 -- Register our own slash commands
17 addon:RegisterSlash(function() 17 addon:RegisterSlash(function()
18 mod:BuildMain(); 18 mod:BuildMain();
19 mod:Build(); 19 mod:Build();
20 end, "s", "sum", "summary"); 20 end, { "s", "sum", "summary" }, "|Hfunction:InventoriumCommandHandler:summary|h|cff00fff7/im summary|r|h (or /im s) - Show the summary window containing an overview of all items within the groups tracked at this current character.");
21 addon:RegisterSlash(function() 21 addon:RegisterSlash(function()
22 if mod.frame then 22 if mod.frame then
23 mod.frame:SetWidth(650); 23 mod.frame:SetWidth(650);
24 mod.frame:SetHeight(600); 24 mod.frame:SetHeight(600);
25 25
26 print("Resetting width and height of the summary frame."); 26 print("Resetting width and height of the summary frame.");
27 end 27 end
28 end, "r", "reset"); 28 end, { "r", "reset" }, "|Hfunction:InventoriumCommandHandler:reset|h|cff00fff7/im reset|r|h (or /im r) - Reset the size of the summary frame.");
29 end 29 end
30 30
31 local function ShowTooltip(self) 31 local function ShowTooltip(self)
32 -- If this function is called from a widget, self is the widget and self.frame the actual frame 32 -- If this function is called from a widget, self is the widget and self.frame the actual frame
33 local this = self.frame or self; 33 local this = self.frame or self;
324 lblQuantity.frame.tooltipTitle = "Current stock"; 324 lblQuantity.frame.tooltipTitle = "Current stock";
325 lblQuantity.frame.tooltip = "Sort on the amount of items currently in stock."; 325 lblQuantity.frame.tooltip = "Sort on the amount of items currently in stock.";
326 326
327 iGroup:AddChild(lblQuantity); 327 iGroup:AddChild(lblQuantity);
328 328
329 -- Local quantity
330 --[[local lblLocal = AceGUI:Create("InteractiveLabel");
331 lblLocal:SetText("|cfffed000Loc.|r");
332 lblLocal:SetFontObject(GameFontHighlight);
333 lblLocal:SetRelativeWidth(.099);
334 lblLocal:SetCallback("OnClick", function() ReSort("current"); end);
335 lblLocal:SetCallback("OnEnter", ShowTooltip);
336 lblLocal:SetCallback("OnLeave", HideTooltip);
337 lblLocal.frame.tooltipTitle = "Local stock";
338 lblLocal.frame.tooltip = "Sort on the amount of items currently in local stock.";
339
340 iGroup:AddChild(lblLocal);]]
341
329 -- Required stock 342 -- Required stock
330 local lblMinimumStock = AceGUI:Create("InteractiveLabel"); 343 local lblMinimumStock = AceGUI:Create("InteractiveLabel");
331 lblMinimumStock:SetText("|cfffed000Min.|r"); 344 lblMinimumStock:SetText("|cfffed000Min.|r");
332 lblMinimumStock:SetFontObject(GameFontHighlight); 345 lblMinimumStock:SetFontObject(GameFontHighlight);
333 lblMinimumStock:SetRelativeWidth(.099); 346 lblMinimumStock:SetRelativeWidth(.099);
366 name = itemName or unknownItemName:format(itemId), 379 name = itemName or unknownItemName:format(itemId),
367 link = itemLink, 380 link = itemLink,
368 value = ((priceThreshold == 0 and not alwaysGetAuctionValue) and -4) or -3,-- if (no price threshold is set for this item and you don't want to always get auction value), then don't look it up either --addon:GetAuctionValue(itemLink), 381 value = ((priceThreshold == 0 and not alwaysGetAuctionValue) and -4) or -3,-- if (no price threshold is set for this item and you don't want to always get auction value), then don't look it up either --addon:GetAuctionValue(itemLink),
369 rarity = itemRarity or 1, 382 rarity = itemRarity or 1,
370 count = -3,--addon:GetItemCount(itemId, groupName), 383 count = -3,--addon:GetItemCount(itemId, groupName),
384 --localCount = -3,
371 set = {}, 385 set = {},
372 }); 386 });
373 CACHE_ITEMS_TOTAL = CACHE_ITEMS_TOTAL + 1; 387 CACHE_ITEMS_TOTAL = CACHE_ITEMS_TOTAL + 1;
374 end 388 end
375 end 389 end
452 lblQuantity:SetText(self:DisplayItemCount(item.count, minimumStock)); 466 lblQuantity:SetText(self:DisplayItemCount(item.count, minimumStock));
453 lblQuantity:SetRelativeWidth(.099); 467 lblQuantity:SetRelativeWidth(.099);
454 468
455 iGroup:AddChild(lblQuantity); 469 iGroup:AddChild(lblQuantity);
456 470
471 -- Local quantity
472 --[[local lblLocal = AceGUI:Create("Label");
473 lblLocal:SetText(self:DisplayItemCount(item.count, minimumStock));
474 lblLocal:SetRelativeWidth(.099);
475
476 iGroup:AddChild(lblLocal);]]
477
457 -- Required stock 478 -- Required stock
458 local lblMinimumStock = AceGUI:Create("Label"); 479 local lblMinimumStock = AceGUI:Create("Label");
459 lblMinimumStock:SetText(minimumStock); 480 lblMinimumStock:SetText(minimumStock);
460 lblMinimumStock:SetRelativeWidth(.099); 481 lblMinimumStock:SetRelativeWidth(.099);
461 482