annotate Modules/Options.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 |
bbba2fae0f69 |
rev |
line source |
Asa@3
|
1 local addonName, addonTable = ...;
|
Asa@3
|
2 local addon = _G[addonName]
|
Asa@3
|
3
|
Asa@3
|
4 local utils = addonTable.utils
|
Asa@3
|
5
|
Asa@3
|
6 local options = {
|
Asa@3
|
7 name = "ItemAuditor",
|
Asa@3
|
8 handler = addon,
|
Asa@3
|
9 type = 'group',
|
Asa@3
|
10 args = {
|
Asa@3
|
11 debug = {
|
Asa@3
|
12 type = "toggle",
|
Asa@3
|
13 name = "Debug",
|
Asa@3
|
14 desc = "Toggles debug messages in chat",
|
Asa@3
|
15 handler = utils,
|
Asa@3
|
16 get = "GetDebug",
|
Asa@3
|
17 set = "SetDebug"
|
Asa@3
|
18 },
|
Asa@3
|
19 dump = {
|
Asa@3
|
20 type = "execute",
|
Asa@3
|
21 name = "dump",
|
Asa@3
|
22 desc = "dumps IA database",
|
Asa@3
|
23 func = "DumpInfo",
|
Asa@3
|
24 },
|
Asa@3
|
25 options = {
|
Asa@3
|
26 type = "execute",
|
Asa@3
|
27 name = "options",
|
Asa@3
|
28 desc = "Show Blizzard's options GUI",
|
Asa@3
|
29 func = "ShowOptionsGUI",
|
Asa@3
|
30 guiHidden = true,
|
Asa@3
|
31 },
|
Asa@3
|
32 },
|
Asa@3
|
33 }
|
Asa@3
|
34
|
Asa@3
|
35 function addon:RegisterOptions()
|
Asa@3
|
36 self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ItemAuditor", "ItemAuditor")
|
Asa@3
|
37 LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", options, {"ia"})
|
Asa@3
|
38 end
|
Asa@3
|
39
|
Asa@3
|
40 function addon:DumpInfo()
|
Asa@3
|
41 self:Print("self.db.char")
|
Asa@3
|
42 DevTools_Dump(self.db.char)
|
Asa@3
|
43 self:Print("self.db.factionrealm")
|
Asa@3
|
44 DevTools_Dump(self.db.factionrealm)
|
Asa@3
|
45 end
|
Asa@3
|
46
|
Asa@3
|
47 function addon:ShowOptionsGUI()
|
Asa@3
|
48 InterfaceOptionsFrame_OpenToCategory(self.optionsFrame)
|
Asa@3
|
49 end
|
Asa@3
|
50
|
Asa@3
|
51 function addon:GetDebug(info)
|
Asa@3
|
52 return self.db.char.debug
|
Asa@3
|
53 end
|
Asa@3
|
54
|
Asa@3
|
55 function addon:SetDebug(info, input)
|
Asa@3
|
56 self.db.char.debug = input
|
Asa@3
|
57 local value = "off"
|
Asa@3
|
58 if input then
|
Asa@3
|
59 value = "on"
|
Asa@3
|
60 end
|
Asa@3
|
61 self:Print("Debugging is now: " .. value)
|
Asa@3
|
62 end
|