Mercurial > wow > itemauditor
comparison Core.lua @ 28:34daa46b644a
Added an interface to view how much you have invested in each item.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Fri, 16 Jul 2010 01:32:08 -0700 |
parents | 75d917ccd942 |
children | f99b9602bdab |
comparison
equal
deleted
inserted
replaced
27:5da5d85cd714 | 28:34daa46b644a |
---|---|
44 self:RegisterEvent("PLAYER_ENTERING_WORLD") | 44 self:RegisterEvent("PLAYER_ENTERING_WORLD") |
45 | 45 |
46 -- /run ItemAuditor.db.profile.show_debug_frame_on_startup = true | 46 -- /run ItemAuditor.db.profile.show_debug_frame_on_startup = true |
47 if self.db.profile.show_debug_frame_on_startup then | 47 if self.db.profile.show_debug_frame_on_startup then |
48 ItemAuditor_DebugFrame:Show() | 48 ItemAuditor_DebugFrame:Show() |
49 self:CreateFrames() | |
49 end | 50 end |
50 end | 51 end |
51 | 52 |
52 function addon:ConvertItems() | 53 function addon:ConvertItems() |
53 for itemName, value in pairs(self.db.factionrealm.item_account) do | 54 for itemName, value in pairs(self.db.factionrealm.item_account) do |
229 invested = abs(self.db.factionrealm.item_account[itemName] or 0), | 230 invested = abs(self.db.factionrealm.item_account[itemName] or 0), |
230 } | 231 } |
231 | 232 |
232 end | 233 end |
233 | 234 |
234 | 235 if self.items[link] ~= nil then |
236 if self.items[link].invested == nil or self.items[link].invested <= 0 then | |
237 self.items[link] = nil | |
238 end | |
239 end | |
235 | 240 |
236 if viewOnly == true and self.items[link] == nil then | 241 if viewOnly == true and self.items[link] == nil then |
237 return {count = 0, invested = 0} | 242 return {count = 0, invested = 0} |
238 elseif viewOnly == true then | 243 elseif viewOnly == true then |
244 | |
239 return {count = self.items[link].count, invested = self.items[link].invested} | 245 return {count = self.items[link].count, invested = self.items[link].invested} |
240 end | 246 end |
241 self.items[link].count = Altoholic:GetItemCount(self:GetIDFromLink(link)) | 247 self.items[link].count = Altoholic:GetItemCount(self:GetIDFromLink(link)) |
242 self.items[link].invested = tonumber(self.items[link].invested) | 248 |
249 | |
243 return self.items[link] | 250 return self.items[link] |
244 end | 251 end |
245 | 252 |
246 function addon:RemoveItem(link) | 253 function addon:RemoveItem(link) |
247 self.db.factionrealm.item_account[link] = nil | 254 self.db.factionrealm.item_account[link] = nil |