Mercurial > wow > itemauditor
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 6:5dddd73b2220 | 7:bbba2fae0f69 |
|---|---|
| 35 function addon:RegisterOptions() | 35 function addon:RegisterOptions() |
| 36 self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ItemAuditor", "ItemAuditor") | 36 self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ItemAuditor", "ItemAuditor") |
| 37 LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", options, {"ia"}) | 37 LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", options, {"ia"}) |
| 38 end | 38 end |
| 39 | 39 |
| 40 local function pairsByKeys (t, f) | |
| 41 local a = {} | |
| 42 for n in pairs(t) do table.insert(a, n) end | |
| 43 table.sort(a, f) | |
| 44 local i = 0 -- iterator variable | |
| 45 local iter = function () -- iterator function | |
| 46 i = i + 1 | |
| 47 if a[i] == nil then return nil | |
| 48 else return a[i], t[a[i]] | |
| 49 end | |
| 50 end | |
| 51 return iter | |
| 52 end | |
| 53 | |
| 40 function addon:DumpInfo() | 54 function addon:DumpInfo() |
| 41 self:Print("self.db.char") | 55 for itemName, value in pairsByKeys(self.db.factionrealm.item_account) do |
| 42 DevTools_Dump(self.db.char) | 56 self:Print(itemName .. ": " .. utils:FormatMoney(value)) |
| 43 self:Print("self.db.factionrealm") | 57 end |
| 44 DevTools_Dump(self.db.factionrealm) | |
| 45 end | 58 end |
| 59 | |
| 46 | 60 |
| 47 function addon:ShowOptionsGUI() | 61 function addon:ShowOptionsGUI() |
| 48 InterfaceOptionsFrame_OpenToCategory(self.optionsFrame) | 62 InterfaceOptionsFrame_OpenToCategory(self.optionsFrame) |
| 49 end | 63 end |
| 50 | 64 |
