changeset 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 c6230eb845ad
children 1f30a9ac9027
files Core.lua Inventory.toc Summary.lua
diffstat 3 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Core.lua	Fri Oct 08 16:38:47 2010 +0200
+++ b/Core.lua	Fri Oct 08 17:10:34 2010 +0200
@@ -514,7 +514,7 @@
 							
 							-- We MUST close this pullout or we can get errors or even game client crashes once we click another group or close the config dialog!
 							local count = AceGUI:GetNextWidgetNum("Dropdown-Pullout");
-							for i = 0, count do
+							for i = 1, count do
 								if _G['AceGUI30Pullout' .. i] then
 									_G['AceGUI30Pullout' .. i]:Hide();
 								end
@@ -1001,7 +1001,7 @@
 								
 								-- We MUST close this pullout or we can get errors or even game client crashes once we click another group or close the config dialog!
 								local count = AceGUI:GetNextWidgetNum("Dropdown-Pullout");
-								for i = 0, count do
+								for i = 1, count do
 									if _G['AceGUI30Pullout' .. i] then
 										_G['AceGUI30Pullout' .. i]:Hide();
 									end
@@ -1466,6 +1466,8 @@
 								end
 							
 								self.db.global.groups[name] = temp;
+								
+								self:FillGroupOptions();
 							end
 						end,
 						get = false,
@@ -1527,6 +1529,8 @@
 	
 		return lowBuy;
 	end
+	
+	return -2;
 end
 
 
--- a/Inventory.toc	Fri Oct 08 16:38:47 2010 +0200
+++ b/Inventory.toc	Fri Oct 08 17:10:34 2010 +0200
@@ -4,6 +4,8 @@
 ## Author: Zerotorescue
 ## Version: @project-version@
 ## SavedVariables: InventoryDB
+## Dependencies: Altoholic
+## OptionalDeps: Auc-Advanced, Auc-ScanData, AdvancedTradeSkillWindow, Skillet, GnomeWorks, Auctionator
 
 embeds.xml
 
--- a/Summary.lua	Fri Oct 08 16:38:47 2010 +0200
+++ b/Summary.lua	Fri Oct 08 17:10:34 2010 +0200
@@ -73,6 +73,7 @@
 	mod.frame:SetLayout("Fill");
 	mod.frame:SetCallback("OnClose", function(widget)
 		AceGUI:Release(widget);
+		mod:CancelTimer(self.tmrUpdater, true);
 	end);
 	
 	-- ScrollFrame child
@@ -280,6 +281,7 @@
 	
 	if CACHE_ITEMS_TOTAL > 0 then
 		cacheStart = GetTime();
+		self:CancelTimer(self.tmrUpdater, true);
 		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)
 	end
 end
@@ -308,7 +310,7 @@
 				i = i + 1;
 				CACHE_ITEMS_CURRENT = CACHE_ITEMS_CURRENT + 1;
 				
-				mod.frame:SetStatusText("Caching auction values and item-counts... " .. floor(CACHE_ITEMS_CURRENT / CACHE_ITEMS_TOTAL * 100) .. "% has already been processed.");
+				mod.frame:SetStatusText(("Caching auction values and item-counts... %d% has already been processed."):format(floor(CACHE_ITEMS_CURRENT / CACHE_ITEMS_TOTAL * 100)));
 				
 				if i >= CACHE_ITEMS_PER_UPDATE then
 					return;
@@ -349,7 +351,11 @@
 end
 
 function mod:DisplayMoney(value, priceThreshold)
-	if value < priceThreshold then
+	if value == -1 then
+		return "|cff0000ffNone up|r";
+	elseif value == -2 then
+		return "|cff0000ffNo AH mod|r";
+	elseif value < priceThreshold then
 		return ("|cffff0000%s|r"):format(addon:ReadableMoney(value or 0, true));
 	else
 		return addon:ReadableMoney(value or 0, true);