Mercurial > wow > itemauditor
diff Modules/Options.lua @ 7:bbba2fae0f69
Removed some of the extra debugging that isn't neccessary any more and abtracted out the item ids so they can be cached.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Tue, 08 Jun 2010 11:19:16 -0700 |
parents | bbcf81868171 |
children | 6a6296dd249f |
line wrap: on
line diff
--- a/Modules/Options.lua Wed May 26 22:41:47 2010 -0700 +++ b/Modules/Options.lua Tue Jun 08 11:19:16 2010 -0700 @@ -37,13 +37,27 @@ LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", options, {"ia"}) end +local function pairsByKeys (t, f) + local a = {} + for n in pairs(t) do table.insert(a, n) end + table.sort(a, f) + local i = 0 -- iterator variable + local iter = function () -- iterator function + i = i + 1 + if a[i] == nil then return nil + else return a[i], t[a[i]] + end + end + return iter +end + function addon:DumpInfo() - self:Print("self.db.char") - DevTools_Dump(self.db.char) - self:Print("self.db.factionrealm") - DevTools_Dump(self.db.factionrealm) + for itemName, value in pairsByKeys(self.db.factionrealm.item_account) do + self:Print(itemName .. ": " .. utils:FormatMoney(value)) + end end + function addon:ShowOptionsGUI() InterfaceOptionsFrame_OpenToCategory(self.optionsFrame) end