Mercurial > wow > itemauditor
comparison Core.lua @ 4:c940b527ccab
Fixed Milling. Disenchating will probably have to be fixed the same way
| author | Asa Ayers <Asa.Ayers@Gmail.com> |
|---|---|
| date | Sat, 22 May 2010 15:23:11 -0700 |
| parents | bbcf81868171 |
| children | 7d0f4ebedf8c |
comparison
equal
deleted
inserted
replaced
| 3:bbcf81868171 | 4:c940b527ccab |
|---|---|
| 129 if item_account[item] >= 0 then | 129 if item_account[item] >= 0 then |
| 130 item_account[item] = nil | 130 item_account[item] = nil |
| 131 end | 131 end |
| 132 end | 132 end |
| 133 | 133 |
| 134 local defaultBagDelay = 0.2 | |
| 135 | |
| 134 function addon:WatchBags(delay) | 136 function addon:WatchBags(delay) |
| 135 if self.watch_handle == nil then | 137 delay = delay or defaultBagDelay |
| 136 delay = delay or 0.2 | 138 if delay ~= self.currentBagDelay then |
| 137 self.lastInventory = self:GetCurrentInventory() | 139 self:UnwatchBags() |
| 138 self.watch_handle = self:RegisterBucketEvent({"BAG_UPDATE", "PLAYER_MONEY"}, delay, "UpdateAudit") | 140 end |
| 139 end | 141 |
| 142 if self.watch_handle == nil then | |
| 143 self.currentBagDelay = delay | |
| 144 self:Debug("currentBagDelay = " .. delay) | |
| 145 addon:UpdateCurrentInventory() | |
| 146 self.watch_handle = self:RegisterBucketEvent({"BAG_UPDATE", "PLAYER_MONEY"}, self.currentBagDelay, "UpdateAudit") | |
| 147 end | |
| 140 end | 148 end |
| 141 | 149 |
| 142 function addon:UnwatchBags() | 150 function addon:UnwatchBags() |
| 143 if self.watch_handle ~= nil then | 151 if self.watch_handle ~= nil then |
| 144 self:UnregisterBucket(self.watch_handle) | 152 self:UnregisterBucket(self.watch_handle) |
| 145 self.watch_handle = nil | 153 self.watch_handle = nil |
| 146 end | 154 end |
| 147 end | 155 end |
| 148 | |
| 149 | |
| 150 | 156 |
| 151 function addon:GetItemCost(itemName, countModifier) | 157 function addon:GetItemCost(itemName, countModifier) |
| 152 local invested = abs(self.db.factionrealm.item_account[itemName] or 0) | 158 local invested = abs(self.db.factionrealm.item_account[itemName] or 0) |
| 153 | 159 |
| 154 if invested > 0 then | 160 if invested > 0 then |
