Mercurial > wow > itemauditor
comparison Modules/Options.lua @ 13:8c83d5f6e306
OPTIONS! QuickAuctions is now an optional dependency. I have also added some configuration options for it. If you have QA but don't want IA to update your thresholds you can shut off the integration. I have also added other options so you can select your faction or the neutral AH and it will update the tooltip.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Fri, 02 Jul 2010 21:39:24 -0700 |
parents | 6a6296dd249f |
children | 44e70a3fdb19 |
comparison
equal
deleted
inserted
replaced
12:6a6296dd249f | 13:8c83d5f6e306 |
---|---|
1 local addonName, addonTable = ...; | 1 local addonName, addonTable = ...; |
2 local addon = _G[addonName] | 2 local addon = _G[addonName] |
3 | 3 |
4 local utils = addonTable.utils | 4 local utils = addonTable.utils |
5 | 5 |
6 local currentFaction = UnitFactionGroup("player") | |
7 local AHFactions = { currentFaction, 'Neutral' } | |
8 | |
6 local options = { | 9 local options = { |
10 handler = addon, | |
7 name = "ItemAuditor", | 11 name = "ItemAuditor", |
8 handler = addon, | |
9 type = 'group', | 12 type = 'group', |
10 args = { | 13 args = { |
11 dbg = { | 14 prices = { |
12 type = "toggle", | 15 name = "Prices", |
13 name = "Debug", | 16 desc = "Control how your minimum price is calculated.", |
14 desc = "Toggles debug messages in chat", | 17 type = 'group', |
15 get = "GetDebug", | 18 args = { |
16 set = "SetDebug" | 19 auction_house = { |
20 type = "select", | |
21 name = "Auction House", | |
22 desc = "", | |
23 values = { currentFaction, 'Neutral' }, | |
24 get = 'GetAH', | |
25 set = 'SetAH', | |
26 }, | |
27 }, | |
17 }, | 28 }, |
18 dump = { | 29 |
19 type = "execute", | 30 |
20 name = "dump", | 31 messages = { |
21 desc = "dumps IA database", | 32 name = "Messages", |
22 func = "DumpInfo", | 33 desc = "Control which messages display in your chat window.", |
34 type = 'group', | |
35 args = { | |
36 dbg = { | |
37 type = "toggle", | |
38 name = "Debug", | |
39 desc = "Toggles debug messages in chat", | |
40 get = "GetDebug", | |
41 set = "SetDebug", | |
42 order = 0, | |
43 }, | |
44 }, | |
23 }, | 45 }, |
24 refresh_qa = { | 46 |
25 type = "execute", | 47 qa_options = { |
26 name = "Refresh QA Thresholds", | 48 name = "QA Options", |
27 desc = "Resets all Quick Auctions thresholds", | 49 desc = "Control how ItemAuditor integrates with QuickAuctions", |
28 func = "RefreshQAGroups", | 50 type = 'group', |
51 -- disabled = (not addon.QA_compatibile), | |
52 disabled = function() return not ItemAuditor:IsQACompatible() end, | |
53 args = { | |
54 toggle_qa = { | |
55 type = "toggle", | |
56 name = "Enable Quick Auctions", | |
57 desc = "This will enable or disable Quick Auctions integration", | |
58 get = "IsQAEnabled", | |
59 set = "SetQAEnabled", | |
60 order = 0, | |
61 }, | |
62 --[[ | |
63 add_mail = { | |
64 type = "toggle", | |
65 name = "Add mail cost to QA Threshold", | |
66 get = "IsQAEnabled", | |
67 set = "SetQAEnabled", | |
68 order = 1, | |
69 }, | |
70 ]] | |
71 refresh_qa = { | |
72 type = "execute", | |
73 name = "Refresh QA Thresholds", | |
74 desc = "Resets all Quick Auctions thresholds", | |
75 func = "RefreshQAGroups", | |
76 disabled = 'IsQADisabled', | |
77 }, | |
78 } | |
29 }, | 79 }, |
30 options = { | 80 options = { |
31 type = "execute", | 81 type = "execute", |
32 name = "options", | 82 name = "options", |
33 desc = "Show Blizzard's options GUI", | 83 desc = "Show Blizzard's options GUI", |
54 end | 104 end |
55 end | 105 end |
56 return iter | 106 return iter |
57 end | 107 end |
58 | 108 |
109 function addon:GetAH() | |
110 return ItemAuditor.db.char.ah | |
111 end | |
112 | |
113 function addon:SetAH(info, value) | |
114 ItemAuditor.db.char.ah = value | |
115 end | |
116 | |
117 function addon:GetAHCut() | |
118 if ItemAuditor.db.char.ah == 1 then | |
119 return 0.05 | |
120 end | |
121 return 0.15 | |
122 end | |
123 | |
124 function addon:GetAHFaction() | |
125 return AHFactions[ItemAuditor.db.char.ah] | |
126 end | |
127 | |
59 function addon:DumpInfo() | 128 function addon:DumpInfo() |
60 for itemName, value in pairsByKeys(self.db.factionrealm.item_account) do | 129 for itemName, value in pairsByKeys(self.db.factionrealm.item_account) do |
61 self:Print(itemName .. ": " .. utils:FormatMoney(value)) | 130 self:Print(itemName .. ": " .. utils:FormatMoney(value)) |
62 end | 131 end |
63 end | 132 end |