Mercurial > wow > inventory
comparison ItemCountAddons/DataStore (without guilds).lua @ 54:06fee4208bf2
Altoholic should now properly show an on select message when chosen.
Selecting DataStore as item count addons should no longer break.
The local item count displayed in the summary is now actually local rather than global.
author | Zerotorescue |
---|---|
date | Mon, 20 Dec 2010 14:30:31 +0100 |
parents | 8f5c02113c5c |
children |
comparison
equal
deleted
inserted
replaced
53:4fc49c9a8f2b | 54:06fee4208bf2 |
---|---|
9 for accountName in pairs(DataStore:GetAccounts()) do | 9 for accountName in pairs(DataStore:GetAccounts()) do |
10 | 10 |
11 -- Process all charracters | 11 -- Process all charracters |
12 for characterName, character in pairs(DataStore:GetCharacters(realm, accountName)) do | 12 for characterName, character in pairs(DataStore:GetCharacters(realm, accountName)) do |
13 -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) | 13 -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) |
14 local bag, bank = DataStore:GetContainerItemCount(character, itemId); | 14 local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; |
15 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId); | 15 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; |
16 local mail = DataStore:GetMailItemCount(character, itemId); | 16 local mail = DataStore:GetMailItemCount(character, itemId) or 0; |
17 | 17 |
18 totalCount = totalCount + bag + bank + auctionHouse + mail; | 18 totalCount = totalCount + bag + bank + auctionHouse + mail; |
19 end | 19 end |
20 end | 20 end |
21 | 21 |
23 end | 23 end |
24 | 24 |
25 local function GetCharacterCount(itemId) | 25 local function GetCharacterCount(itemId) |
26 local character = DataStore:GetCharacter(); | 26 local character = DataStore:GetCharacter(); |
27 | 27 |
28 local bag, bank = DataStore:GetContainerItemCount(character, itemId); | 28 local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; |
29 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId); | 29 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; |
30 local mail = DataStore:GetMailItemCount(character, itemId); | 30 local mail = DataStore:GetMailItemCount(character, itemId) or 0; |
31 | 31 |
32 return bag, bank, auctionHouse, mail; | 32 return bag, bank, auctionHouse, mail; |
33 end | 33 end |
34 | 34 |
35 local function IsEnabled() | 35 local function IsEnabled() |