Mercurial > wow > inventory
view ItemCountAddons/DataStore (without guilds).lua @ 62:fee06221176f
Seperated the config from Core.lua.
Many other code cleaning up for readability.
Added local references for much used globals.
Moved widgets to a different file for readability.
Re-added global function for slash command handling since we do need it for our chat-hyperlinks.
Fixed queueing to properly use the track at property of virtual groups.
Fixed queueing to display the item id instead of the item link if the item link could not be loaded.
Speed slider at the summary now has an interval of 1% down from 5% and rounds rather than ceils it?s value so 101% will become 100% rather than 105%.
Now using the right stock properties at the summary.
Added a help group to the config.
author | Zerotorescue |
---|---|
date | Wed, 22 Dec 2010 19:56:55 +0100 |
parents | 06fee4208bf2 |
children |
line wrap: on
line source
do local function GetTotalCount(itemId) local realm = GetRealmName(); local totalCount = 0; -- Process all accounts for accountName in pairs(DataStore:GetAccounts()) do -- Process all charracters for characterName, character in pairs(DataStore:GetCharacters(realm, accountName)) do -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; local mail = DataStore:GetMailItemCount(character, itemId) or 0; totalCount = totalCount + bag + bank + auctionHouse + mail; end end return totalCount or -1; end local function GetCharacterCount(itemId) local character = DataStore:GetCharacter(); local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; local mail = DataStore:GetMailItemCount(character, itemId) or 0; return bag, bank, auctionHouse, mail; end local function IsEnabled() return (DataStore and DataStore.GetContainerItemCount and DataStore.GetAuctionHouseItemCount and DataStore.GetMailItemCount); end IMRegisterItemCountAddon("DataStore (without guilds)", GetTotalCount, GetCharacterCount, IsEnabled); end