changeset 65:ac1189599769

Added warning to AuctionLite pricing addon selection stating the addon wasn?t tested properly yet. Premade groups check now occurs when the config is opened rather than upon login. All multiselects are now dropdowns as they are meant to be. Please ensure the pullouts are closed before switching groups or closing the window or you may get some LUA errors (thanks Wowace for not fixing what seems to be a year old issue). Hopefully added support for the crafting addon ?Cauldron?, but this still has to be tested.
author Zerotorescue
date Thu, 23 Dec 2010 03:19:27 +0100
parents 0bd50500561c
children 057f6661ad9d
files AuctionAddons/AuctionLite.lua Config.lua Core.lua CraftingAddons/Cauldron.lua Inventorium.toc Todo.txt
diffstat 6 files changed, 159 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/AuctionAddons/AuctionLite.lua	Wed Dec 22 20:01:13 2010 +0100
+++ b/AuctionAddons/AuctionLite.lua	Thu Dec 23 03:19:27 2010 +0100
@@ -10,6 +10,12 @@
 		return (AuctionLite and AuctionLite.GetHistoricalPriceById);
 	end
 	
-	IMRegisterPricingAddon("AuctionLite", GetValue, IsEnabled);
+	local function OnSelect()
+		local addonName = "|r|cfffed000AuctionLite|r|cffff6600";
+		
+		print("|cffff6600" .. addonName .. " appears to not be working properly at this time. Please try another addon. This will be corrected in the future, sorry for the inconvenience.|r");
+	end
+	
+	IMRegisterPricingAddon("AuctionLite", GetValue, IsEnabled, OnSelect);
 	
 end
--- a/Config.lua	Wed Dec 22 20:01:13 2010 +0100
+++ b/Config.lua	Thu Dec 23 03:19:27 2010 +0100
@@ -421,7 +421,7 @@
 								["Mailbox"] = "Mailbox",
 							},
 							get = GetMultiOption,
-							--dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead.
+							dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead.
 							arg = "overrideLocalItemData",
 						},
 						virtualGroup = {
@@ -579,7 +579,7 @@
 								return temp;
 							end,
 							get = GetMultiOption,
-							--dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead.
+							dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead.
 							arg = "overrideTrackAtCharacters",
 						},
 					},
@@ -1190,11 +1190,15 @@
 end
 
 function mod:RefreshConfig()
+	self:PremadeGroupsCheck();
+	
 	self:FillGroupOptions();
 end
 
 function mod:Load()
 	if not AceConfigDialog and not AceConfigRegistry then
+		self:PremadeGroupsCheck();
+		
 		self:FillOptions();
 	
 		-- Build options dialog
@@ -1372,7 +1376,7 @@
 						},
 						get = function(i, v) return addon.db.profile.defaults.localItemData and addon.db.profile.defaults.localItemData[v]; end,
 						set = function(i, v, e) addon.db.profile.defaults.localItemData[v] = e or nil; end,
-						--dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead.
+						dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead.
 					},
 				},
 			},
@@ -1460,7 +1464,7 @@
 						end,
 						get = function(i, v) return addon.db.profile.defaults.trackAtCharacters[v]; end,
 						set = function(i, v, e) addon.db.profile.defaults.trackAtCharacters[v] = e or nil; end,
-						--dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead.
+						dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead.
 					},
 				},
 			},
@@ -1903,3 +1907,95 @@
 		end
 	end
 end
+
+
+
+
+
+
+-- Verify premade groups
+
+function mod:PremadeGroupsCheck(updateGroupName, updateKey, accept)
+	-- Compare the current premade groups with those used, notify about changes
+	if addon.defaultGroups then
+		for premadeGroupName, groupInfo in pairs(addon.defaultGroups) do
+			-- Go through all default groups
+			
+			for groupName, values in pairs(addon.db.profile.groups) do
+				-- Go through all groups to find those with this premade group
+				
+				if values.premadeGroups and values.premadeGroups[premadeGroupName] and values.premadeGroups[premadeGroupName] < groupInfo.version then
+					-- Outdated group
+					
+					if updateGroupName and updateKey then
+						-- This function was called after pressing yes or no in a confirm box
+						
+						if accept then
+							-- Yes was clicked
+							
+							for itemId, version in pairs(groupInfo.items) do
+								-- Go through all items in this premade group
+								
+								if version > values.premadeGroups[premadeGroupName] then
+									-- This item was added in a more recent version than this group: Add item
+									
+									if addon:InGroup(itemId) then
+										print(("Skipping %s (#%d) as it is already in the group |cfffed000%s|r."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, addon:InGroup(itemId)));
+									elseif addon:AddItemToGroup(groupName, itemId) then
+										print(("|cff00ff00Added|r %s (#%d) found in the premade group |cfffed000%s|r to the group |cfffed000%s|r."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, premadeGroupName, addon:InGroup(itemId)));
+									end
+								elseif ( version * -1 ) > values.premadeGroups[premadeGroupName] then
+									if addon:InGroup(itemId) == groupName then
+										print(("|cffff0000Removed|r %s (#%d) from the group |cfffed000%s|r as it was removed from the premade group |cfffed000%s|r."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, addon:InGroup(itemId), premadeGroupName));
+										addon:RemoveItemFromGroup(groupName, itemId);
+									else
+										print(("Skipping the removal of %s (#%d) as it isn't in this group."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, addon:InGroup(itemId)));
+									end
+								end
+							end
+							
+							-- Remember the new version
+							values.premadeGroups[premadeGroupName] = groupInfo.version;
+						else
+							-- No was clicked
+							
+							-- Let user know what was not added
+							for itemId, version in pairs(groupInfo.items) do
+								-- Go through all items in this premade group
+								
+								if version > values.premadeGroups[premadeGroupName] then
+									-- This item was added in a more recent version than this group: don't add (since we clicked no), but announce it
+									
+									print(("Skipping %s (#%d) found in the premade group |cfffed000%s|r."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, addon:InGroup(itemId)));
+								end
+							end
+							
+							-- Remember the new version
+							values.premadeGroups[premadeGroupName] = groupInfo.version;
+						end
+					else
+						StaticPopupDialogs["InventoriumConfirmUpdatePremadeGroup"] = {
+							text = "The premade group |cfffed000%s|r used in the group |cfffed000%s|r has been changed. Do you wish to copy these changes?",
+							button1 = YES,
+							button2 = NO,
+							OnAccept = function()
+								addon:PremadeGroupsCheck(groupName, premadeGroupName, true);
+							end,
+							OnCancel = function(_, _, reason)
+								if reason == "clicked" then
+									addon:PremadeGroupsCheck(groupName, premadeGroupName, false);
+								end
+							end,
+							timeout = 0,
+							whileDead = 1,
+							hideOnEscape = 1,
+						};
+						StaticPopup_Show("InventoriumConfirmUpdatePremadeGroup", premadeGroupName, groupName);
+						
+						return;
+					end
+				end
+			end
+		end
+	end
+end
--- a/Core.lua	Wed Dec 22 20:01:13 2010 +0100
+++ b/Core.lua	Thu Dec 23 03:19:27 2010 +0100
@@ -117,10 +117,14 @@
 		-- Default to tracking on all chars, untracking is a convenience, not tracking by default would probably get multiple issue reports.
 		self.db.profile.defaults.trackAtCharacters[playerName] = true;
 	end
-	
-	self:PremadeGroupsCheck();
 end
 
+
+
+
+
+-- Database patching after new revisions
+
 function addon:UpdateDatabase()
 	if not self.db.global.version or self.db.global.version < addonRevision then
 		-- Is our database outdated? Then patch it.
@@ -184,91 +188,6 @@
 	end
 end
 
-function addon:PremadeGroupsCheck(updateGroupName, updateKey, accept)
-	-- Compare the current premade groups with those used, notify about changes
-	if addon.defaultGroups then
-		for premadeGroupName, groupInfo in pairs(addon.defaultGroups) do
-			-- Go through all default groups
-			
-			for groupName, values in pairs(addon.db.profile.groups) do
-				-- Go through all groups to find those with this premade group
-				
-				if values.premadeGroups and values.premadeGroups[premadeGroupName] and values.premadeGroups[premadeGroupName] < groupInfo.version then
-					-- Outdated group
-					
-					if updateGroupName and updateKey then
-						-- This function was called after pressing yes or no in a confirm box
-						
-						if accept then
-							-- Yes was clicked
-							
-							for itemId, version in pairs(groupInfo.items) do
-								-- Go through all items in this premade group
-								
-								if version > values.premadeGroups[premadeGroupName] then
-									-- This item was added in a more recent version than this group: Add item
-									
-									if self:InGroup(itemId) then
-										print(("Skipping %s (#%d) as it is already in the group |cfffed000%s|r."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, self:InGroup(itemId)));
-									elseif self:AddItemToGroup(groupName, itemId) then
-										print(("|cff00ff00Added|r %s (#%d) found in the premade group |cfffed000%s|r to the group |cfffed000%s|r."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, premadeGroupName, self:InGroup(itemId)));
-									end
-								elseif ( version * -1 ) > values.premadeGroups[premadeGroupName] then
-									if self:InGroup(itemId) == groupName then
-										print(("|cffff0000Removed|r %s (#%d) from the group |cfffed000%s|r as it was removed from the premade group |cfffed000%s|r."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, self:InGroup(itemId), premadeGroupName));
-										self:RemoveItemFromGroup(groupName, itemId);
-									else
-										print(("Skipping the removal of %s (#%d) as it isn't in this group."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, self:InGroup(itemId)));
-									end
-								end
-							end
-							
-							-- Remember the new version
-							values.premadeGroups[premadeGroupName] = groupInfo.version;
-						else
-							-- No was clicked
-							
-							-- Let user know what was not added
-							for itemId, version in pairs(groupInfo.items) do
-								-- Go through all items in this premade group
-								
-								if version > values.premadeGroups[premadeGroupName] then
-									-- This item was added in a more recent version than this group: don't add (since we clicked no), but announce it
-									
-									print(("Skipping %s (#%d) found in the premade group |cfffed000%s|r."):format(select(2, GetItemInfo(itemId)) or "Unknown", itemId, self:InGroup(itemId)));
-								end
-							end
-							
-							-- Remember the new version
-							values.premadeGroups[premadeGroupName] = groupInfo.version;
-						end
-					else
-						StaticPopupDialogs["InventoriumConfirmUpdatePremadeGroup"] = {
-							text = "The premade group |cfffed000%s|r used in the group |cfffed000%s|r has been changed. Do you wish to copy these changes?",
-							button1 = YES,
-							button2 = NO,
-							OnAccept = function(self)
-								addon:PremadeGroupsCheck(groupName, premadeGroupName, true);
-							end,
-							OnCancel = function(self, _, reason)
-								if reason == "clicked" then
-									addon:PremadeGroupsCheck(groupName, premadeGroupName, false);
-								end
-							end,
-							timeout = 0,
-							whileDead = 1,
-							hideOnEscape = 1,
-						};
-						StaticPopup_Show("InventoriumConfirmUpdatePremadeGroup", premadeGroupName, groupName);
-						
-						return;
-					end
-				end
-			end
-		end
-	end
-end
-
 function addon:GetItemId(itemLink)
 	itemLink = itemLink and itemLink:match("|Hitem:([-0-9]+):"); -- if itemLink is nil, it won't execute the second part
 	itemLink = itemLink and tonumber(itemLink);
@@ -376,6 +295,10 @@
 	return -2;
 end
 
+
+
+
+
 -- Slash commands
 
 local slashArgs = {};
@@ -403,6 +326,10 @@
 	end
 end
 
+
+
+
+
 -- Group functions
 
 function addon:InGroup(itemId)
@@ -447,6 +374,10 @@
 	return true;
 end
 
+
+
+
+
 -- Readable money
 
 local goldText = "%s%d|cffffd700g|r ";
@@ -507,6 +438,8 @@
 
 
 
+
+
 -- Public
 
 function IMRegisterPricingAddon(name, get, enabled, onSelect)
@@ -541,6 +474,8 @@
 
 
 
+
+
 -- Debug
 
 function addon:Debug(t)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CraftingAddons/Cauldron.lua	Thu Dec 23 03:19:27 2010 +0100
@@ -0,0 +1,26 @@
+do
+	
+	local function Queue(tradeSkillIndex, amount)
+		CauldronQueue:AddItem(Cauldron.db.realm.userdata[Cauldron.vars.playername].queue, skillInfo, amount);
+			
+		Cauldron:UpdateQueue();
+		
+		-- update the shopping list
+		Cauldron:UpdateShoppingListFromQueue();
+		
+		return;
+	end
+	
+	local function IsEnabled()
+		return (Cauldron and CauldronQueue and CauldronQueue.AddItem);
+	end
+	
+	local function OnSelect()
+		local addonName = "|r|cfffed000Cauldron|r|cffff6600";
+		
+		print("|cffff6600" .. addonName .. " has not yet been tested. Please report any of your experiences.|r");
+	end
+	
+	IMRegisterCraftingAddon("Cauldron", Queue, IsEnabled, OnSelect);
+	
+end
--- a/Inventorium.toc	Wed Dec 22 20:01:13 2010 +0100
+++ b/Inventorium.toc	Thu Dec 23 03:19:27 2010 +0100
@@ -42,5 +42,6 @@
 
 # Crafting addon support
 CraftingAddons\AdvancedTradeSkillWindow.lua
+CraftingAddons\Cauldron.lua
 CraftingAddons\GnomeWorks.lua
 CraftingAddons\Skillet.lua
--- a/Todo.txt	Wed Dec 22 20:01:13 2010 +0100
+++ b/Todo.txt	Thu Dec 23 03:19:27 2010 +0100
@@ -6,4 +6,6 @@
  * Window containing a list of items that were unqueueable when a group is queued (low-medium)
  * Enchanting -> scroll self-learning (low)
  * Local item count display (bags or AH), thresholds and alerts (high)
-	- Simple implementation: add a column displaying this, settings to specify how much should be local and an alert box
\ No newline at end of file
+	- Simple implementation: add a column displaying this, settings to specify how much should be local and an alert box
+ * Verifiy Cauldron support
+ * Verify AuctionLite support
\ No newline at end of file