Mercurial > wow > inventory
diff Modules/Config.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 | fcc95c62d232 |
line wrap: on
line diff
--- a/Modules/Config.lua Sat Jan 22 02:57:08 2011 +0100 +++ b/Modules/Config.lua Sat Jan 22 19:24:48 2011 +0100 @@ -1710,6 +1710,55 @@ end end, }, + guildSelection = { + order = 40, + type = "multiselect", + name = "Include guild bank data", + desc = "Select which guild data should be included in the item counts.", + values = function() + local temp = {}; + + local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); + + if currentAddon.GetGuildNames then + local guilds = currentAddon.GetGuildNames(); + + if guilds and type(guilds) == "table" then + for guildName, state in pairs(guilds) do + temp[guildName] = guildName; + + if addon.db.profile.defaults.itemCountGuildsExcluded[guildName] then + currentAddon.SetGuildState(guildName, false); + else + currentAddon.SetGuildState(guildName, true); + end + end + end + end + + return temp; + end, + get = function(i, v) + local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); + + return currentAddon.GetGuildNames and currentAddon.GetGuildNames()[v]; + end, + set = function(i, v, e) + local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); + + if e then + -- Guild is enabled, so not excluded + addon.db.profile.defaults.itemCountGuildsExcluded[v] = nil; + else + addon.db.profile.defaults.itemCountGuildsExcluded[v] = true; -- this is excluded, excluded is indicated by true + end + + if currentAddon.SetGuildState then + currentAddon.SetGuildState(v, e); + end + end, -- can't be nil or the defaults will be used + 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. + }, }, }, }, @@ -1782,63 +1831,6 @@ }, }, }, - guildSelection = { - order = 15, - type = "group", - inline = true, - name = "Filter item count data", - args = { - description = { - order = 0, - type = "description", - name = "Change which data sources are used in the item counts.", - hidden = function() return addon.db.profile.defaults.hideHelp; end, - }, - header = { - order = 5, - type = "header", - name = "", - hidden = function() return addon.db.profile.defaults.hideHelp; end, - }, - guilds = { - order = 20, - type = "multiselect", - width = "double", - name = "Include guild bank data", - desc = "Select which guild data should be included in the item counts.", - values = function() - local temp = {}; - - local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); - - if currentAddon.GetGuildNames then - local guilds = currentAddon.GetGuildNames(); - - if guilds and type(guilds) == "table" then - for guildName, state in pairs(guilds) do - temp[guildName] = guildName; - end - end - end - - return temp; - end, - get = function(i, v) - local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); - - return currentAddon.GetGuildNames and currentAddon.GetGuildNames()[v]; - end, - set = function(i, v, e) - local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); - - if currentAddon.SetGuildState then - currentAddon:SetGuildState(v, e); - end - end, -- can't be nil or the defaults will be used - 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. - }, - }, - }, export = { order = 20, type = "group",