diff Core.lua @ 157:e136c99fe5bb

You can now select which guilds to include in the item count when selecting an item count supporting this. Renamed DataStore (with guilds) to ?all accounts?. Removed DataStore (without guilds) option.
author Zerotorescue
date Sat, 22 Jan 2011 19:24:48 +0100
parents 314943963155
children d367da49a490
line wrap: on
line diff
--- a/Core.lua	Sat Jan 22 02:57:08 2011 +0100
+++ b/Core.lua	Sat Jan 22 19:24:48 2011 +0100
@@ -36,28 +36,36 @@
 		},
 		profile = {
 			defaults = {
+				-- General
 				auctionPricingAddon = "Auctioneer",
 				itemCountAddon = "Altoholic",
 				craftingAddon = "AdvancedTradeSkillWindow",
+				trackAtCharacters = { },
+				localItemData = {
+					["Bag"] = true,
+					["Auction House"] = true,
+				},
+				
+				-- Minimumm stock
 				minLocalStock = 20,
 				alertBelowLocalMinimum = true,
 				autoRefill = true,
 				autoRefillSkipConfirm = false,
 				minGlobalStock = 60,
 				alertBelowGlobalMinimum = true,
-				summaryThresholdShow = 10,
+				
+				-- Queueing
 				restockTarget = 60,
 				minCraftingQueue = 0.05,
 				bonusQueue = 0.1,
 				priceThreshold = 0,
+				
+				-- Summary
+				summaryThresholdShow = 10,
 				summaryHidePriceThreshold = false,
+				
+				-- Global (can't be overridden)
 				hideHelp = false,
-				trackAtCharacters = {
-				},
-				localItemData = {
-					["Bag"] = true,
-					["Auction House"] = true,
-				},
 				summary = {
 					speed = 5,
 					width = 700,
@@ -69,6 +77,7 @@
 					yellow = 0.6,
 					green = 0.95,
 				},
+				itemCountGuildsExcluded = { },
 			},
 			groups = {
 				-- items = {},
@@ -222,12 +231,20 @@
 	if self.supportedAddons.itemCount[selectedExternalAddon] and self.supportedAddons.itemCount[selectedExternalAddon].IsEnabled() then
 		-- Try to use the default item count addon
 		
+		if self.supportedAddons.itemCount[selectedExternalAddon].SetGuildState then
+			self.supportedAddons.itemCount[selectedExternalAddon].SetGuildState(self.db.profile.defaults.itemCountGuildsExcluded);
+		end
+		
 		return self.supportedAddons.itemCount[selectedExternalAddon], selectedExternalAddon;
 	else
 		-- Default not available, get the first one then
 		
 		for name, value in pairs(self.supportedAddons.itemCount) do
 			if value.IsEnabled() then
+				if value.SetGuildState then
+					value.SetGuildState(self.db.profile.defaults.itemCountGuildsExcluded);
+				end
+				
 				return value, name;
 			end
 		end
@@ -464,12 +481,12 @@
 -- General
 
 addon.Colors = {
-	Red = { 1, 0, 0 },
-	Orange = { 1, .46, .1 },
-	Green = { 0, 1, 0 },
-	Blue = { 0, 0, 1 },
-	Yellow = { 1, 1, 0 },
-	Cyan = { 0, 1, 1 },
+	["Red"] = { 1, 0, 0 },
+	["Orange"] = { 1, .46, .1 },
+	["Green"] = { 0, 1, 0 },
+	["Blue"] = { 0, 0, 1 },
+	["Yellow"] = { 1, 1, 0 },
+	["Cyan"] = { 0, 1, 1 },
 }; -- easy to extend if more colors are needed
 function addon:Print(text, color)
 	local red, green, blue;