changeset 132:0eaec1b52a63

Ticket 40 - Added options to enable counting guild bank inventory.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Wed, 15 Sep 2010 21:33:54 -0700
parents 78c6d905c2e1
children 5eefa40e2a29
files CHANGELOG.txt Core.lua
diffstat 2 files changed, 33 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG.txt	Wed Sep 15 20:45:26 2010 -0700
+++ b/CHANGELOG.txt	Wed Sep 15 21:33:54 2010 -0700
@@ -1,6 +1,7 @@
 2010-09-15  Asa Ayers  <Asa.Ayers@Gmail.com>
 
 - Ticket 41 - Fixed a bug that occured if you created items without ever opening /ia crafting.
+- Ticket 40 - Added options to enable counting guild bank inventory.
 
 2010-09-03  Asa Ayers  <Asa.Ayers@Gmail.com>
 
--- a/Core.lua	Wed Sep 15 20:45:26 2010 -0700
+++ b/Core.lua	Wed Sep 15 21:33:54 2010 -0700
@@ -68,7 +68,8 @@
 		items = {},
 		outbound_cod = {},
 		mailbox = {},
-		queue = {}
+		queue = {},
+		enabled_guilds = {},
 	},
 }
 
@@ -386,6 +387,10 @@
 		count = count + (DataStore:GetMailItemCount(character, searchID) or 0)
 		count = count + (DataStore:GetCurrencyItemCount(character, searchID) or 0)
 	end
+	for guildName in pairs(self.db.factionrealm.enabled_guilds) do
+		count = count + DataStore:GetGuildBankItemCount(DataStore:GetGuilds()[guildName], searchID)
+	end
+
 	local itemName = GetItemInfo(searchID)
 	for character, mailbox in pairs(allMailboxes) do
 		for type, items in pairs(mailbox) do
@@ -570,3 +575,29 @@
 	end
 	return 0, 0, ItemAuditor:GetItemCount(ItemAuditor:GetIDFromLink(link))
 end
+
+ItemAuditor.Options.args.misc= {
+	name = "Misc",
+	type = 'group',
+	args = {
+	},
+}
+local function GetGuild(info)
+	local guildName = info[#(info)]
+	return (ItemAuditor.db.factionrealm.enabled_guilds[guildName] == true)
+end
+
+local function SetGuild(info, value)
+	local guildName = info[#(info)]
+	ItemAuditor.db.factionrealm.enabled_guilds[guildName] = value or nil
+end
+
+for guildName in pairs(DataStore:GetGuilds()) do
+	ItemAuditor.Options.args.misc.args[guildName] = {
+		type = "toggle",
+		name = "Count "..guildName.." Guild Bank",
+		get = GetGuild,
+		set = SetGuild,
+		order = 11,
+	}
+end