Mercurial > wow > inventory
comparison Summary.lua @ 7:1a815139e4c3 v0.1.1-BETA
Fixed pullout hiding to avoid fatal errors.
Updated TOC to include dependencies.
Updated summary to stop timer when closing the window and to make AH mods optional.
author | Zerotorescue |
---|---|
date | Fri, 08 Oct 2010 17:10:34 +0200 |
parents | 9fff13c08f99 |
children | 3bac0bdd59e2 |
comparison
equal
deleted
inserted
replaced
6:c6230eb845ad | 7:1a815139e4c3 |
---|---|
71 mod.frame = AceGUI:Create("Frame"); | 71 mod.frame = AceGUI:Create("Frame"); |
72 mod.frame:SetTitle("Inventory Summary"); | 72 mod.frame:SetTitle("Inventory Summary"); |
73 mod.frame:SetLayout("Fill"); | 73 mod.frame:SetLayout("Fill"); |
74 mod.frame:SetCallback("OnClose", function(widget) | 74 mod.frame:SetCallback("OnClose", function(widget) |
75 AceGUI:Release(widget); | 75 AceGUI:Release(widget); |
76 mod:CancelTimer(self.tmrUpdater, true); | |
76 end); | 77 end); |
77 | 78 |
78 -- ScrollFrame child | 79 -- ScrollFrame child |
79 mod.scrollFrame = AceGUI:Create("ScrollFrame"); | 80 mod.scrollFrame = AceGUI:Create("ScrollFrame"); |
80 mod.scrollFrame:SetLayout("Flow"); | 81 mod.scrollFrame:SetLayout("Flow"); |
278 mod.scrollFrame:ResumeLayout(); | 279 mod.scrollFrame:ResumeLayout(); |
279 mod.scrollFrame:DoLayout(); | 280 mod.scrollFrame:DoLayout(); |
280 | 281 |
281 if CACHE_ITEMS_TOTAL > 0 then | 282 if CACHE_ITEMS_TOTAL > 0 then |
282 cacheStart = GetTime(); | 283 cacheStart = GetTime(); |
284 self:CancelTimer(self.tmrUpdater, true); | |
283 self.tmrUpdater = self:ScheduleRepeatingTimer("UpdateNextItem", .01); -- Once every 100 frames (or once every x frames if you have less than 100 FPS, basically, once every frame) | 285 self.tmrUpdater = self:ScheduleRepeatingTimer("UpdateNextItem", .01); -- Once every 100 frames (or once every x frames if you have less than 100 FPS, basically, once every frame) |
284 end | 286 end |
285 end | 287 end |
286 | 288 |
287 function mod:UpdateNextItem() | 289 function mod:UpdateNextItem() |
306 item.set = nil; | 308 item.set = nil; |
307 | 309 |
308 i = i + 1; | 310 i = i + 1; |
309 CACHE_ITEMS_CURRENT = CACHE_ITEMS_CURRENT + 1; | 311 CACHE_ITEMS_CURRENT = CACHE_ITEMS_CURRENT + 1; |
310 | 312 |
311 mod.frame:SetStatusText("Caching auction values and item-counts... " .. floor(CACHE_ITEMS_CURRENT / CACHE_ITEMS_TOTAL * 100) .. "% has already been processed."); | 313 mod.frame:SetStatusText(("Caching auction values and item-counts... %d% has already been processed."):format(floor(CACHE_ITEMS_CURRENT / CACHE_ITEMS_TOTAL * 100))); |
312 | 314 |
313 if i >= CACHE_ITEMS_PER_UPDATE then | 315 if i >= CACHE_ITEMS_PER_UPDATE then |
314 return; | 316 return; |
315 end | 317 end |
316 end | 318 end |
347 return ("|cffff0000%d|r"):format(num); | 349 return ("|cffff0000%d|r"):format(num); |
348 end | 350 end |
349 end | 351 end |
350 | 352 |
351 function mod:DisplayMoney(value, priceThreshold) | 353 function mod:DisplayMoney(value, priceThreshold) |
352 if value < priceThreshold then | 354 if value == -1 then |
355 return "|cff0000ffNone up|r"; | |
356 elseif value == -2 then | |
357 return "|cff0000ffNo AH mod|r"; | |
358 elseif value < priceThreshold then | |
353 return ("|cffff0000%s|r"):format(addon:ReadableMoney(value or 0, true)); | 359 return ("|cffff0000%s|r"):format(addon:ReadableMoney(value or 0, true)); |
354 else | 360 else |
355 return addon:ReadableMoney(value or 0, true); | 361 return addon:ReadableMoney(value or 0, true); |
356 end | 362 end |
357 end | 363 end |