# HG changeset patch # User Asa Ayers # Date 1284611634 25200 # Node ID 0eaec1b52a639be8384a4addde091b4426bea1d3 # Parent 78c6d905c2e113953a5573f37c0eb04067b28cee Ticket 40 - Added options to enable counting guild bank inventory. diff -r 78c6d905c2e1 -r 0eaec1b52a63 CHANGELOG.txt --- 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 - 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 diff -r 78c6d905c2e1 -r 0eaec1b52a63 Core.lua --- 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