comparison Classes/ContainerItem.class.lua @ 110:67bd5057ecb7

Implemented vendor restocking with the mover. Comitting so I can always review this working version, but I?ll be disabling all part of it as it is not going to work properly without seriously compromising the code structure. Debug messages are now appended with ?Inventorium? (my MailOpener addon was making stuff difficult). Now properly removing the refill window from the displayed static popup windows list so new popups won?t be aligned at odd locations. Changed ?CreateMoverFrame? to not contain any scenario-specific info. All settings can be set with SetFrameSettings. Items that belong to speciality bags are now put there. Other items now ignore spaciality bags. Implemented test code for mailbox refill support. It has been disabled due to some issues but may be introduced later. The guild withdrawal limit is now taken into consideration. Queue is now reset before scanning again.
author Zerotorescue
date Fri, 14 Jan 2011 23:25:05 +0100
parents 3bec0ea44607
children 41f0689dfda1
comparison
equal deleted inserted replaced
109:3bbad0429d87 110:67bd5057ecb7
17 self.locations = {}; 17 self.locations = {};
18 18
19 return self; 19 return self;
20 end 20 end
21 21
22 function addon.ContainerItem:AddLocation(container, slot, count) 22 function addon.ContainerItem:AddLocation(container, slot, count, price)
23 table.insert(self.locations, { 23 table.insert(self.locations, {
24 container = container, 24 ["container"] = container,
25 slot = slot, 25 ["slot"] = slot,
26 count = count, 26 ["count"] = count,
27 ["price"] = price,
27 }); 28 });
28 29
29 self.totalCount = (self.totalCount + count); 30 -- -1 indicates unlimited supply
31 if self.totalCount ~= -1 then
32 if count == -1 then
33 self.totalCount = -1;
34 else
35 self.totalCount = (self.totalCount + count);
36 end
37 end
30 38
31 return true; 39 return true;
32 end 40 end
41
42 function addon.ContainerItem:GetVendorPrice()
43 for _, loc in pairs(self.locations) do
44 if loc.price then
45 return loc.price;
46 end
47 end
48 end