comparison Modules/QuickAuctions.lua @ 112:619ee0a1ff3b

[mq]: QAManagerIntegration
author Asa Ayers <Asa.Ayers@Gmail.com>
date Wed, 01 Sep 2010 23:21:44 -0700
parents 1cb0027da35c
children d94195157a6b
comparison
equal deleted inserted replaced
111:1cb0027da35c 112:619ee0a1ff3b
25 end 25 end
26 26
27 27
28 28
29 function ItemAuditor:IsQACompatible() 29 function ItemAuditor:IsQACompatible()
30 local qam = GetAddOnInfo('QAManager')
31 if qam then
32 ItemAuditor.Options.args.qa_options.disabled = true
33 if ItemAuditor.db.char.use_quick_auctions then
34 ItemAuditor.db.char.use_quick_auctions = false
35 StaticPopupDialogs["ItemAuditor_QAOptionsReplaced"] = {
36 text = "The ability to have ItemAuditor adjust your QA thresholds is being moved to QAManager. If you have to use the options within ItemAuditor you can disable QAManager to restore them for now, but this option will change in the future.",
37 button1 = "OK",
38 timeout = 0,
39 whileDead = true,
40 hideOnEscape = true,
41 OnAccept = function()
42 -- StaticPopupDialogs["ItemAuditor_QAOptionsReplaced"] = nil
43 end,
44 }
45 StaticPopup_Show('ItemAuditor_QAOptionsReplaced')
46 end
47 return false
48 end
30 return (QAAPI ~= nil and QAAPI.GetGroupConfig ~= nil) 49 return (QAAPI ~= nil and QAAPI.GetGroupConfig ~= nil)
31 end 50 end
32 51
33 function ItemAuditor:IsQAEnabled() 52 function ItemAuditor:IsQAEnabled()
34 return ItemAuditor:IsQACompatible() and ItemAuditor.db.char.use_quick_auctions 53 return ItemAuditor:IsQACompatible() and ItemAuditor.db.char.use_quick_auctions
118 return -1 137 return -1
119 end 138 end
120 end 139 end
121 return 0 140 return 0
122 end 141 end
123 Crafting.RegisterCraftingDecider('IA QuickAuctions', isProfitable) 142
143 local QADeciderOptions = {
144 extra = {
145 type = "range",
146 name = "Create Extra",
147 desc = "This is the amount of an item that should be created above what you sell in one post in QuickAuctions."..
148 "If you sell 4 stacks of 5 of an item and your extra is 25%, it will queue enough for you to have 25 of that item.",
149 min = 0.0,
150 max = 1.0,
151 step = 0.01,
152 isPercent = true,
153 get = function() return ItemAuditor.db.char.qa_extra end,
154 set = function(info, value)
155 ItemAuditor.db.char.qa_extra = value
156 end,
157 handler = ItemAuditor,
158 disabled = 'IsQACompatible',
159 order = 10,
160 },
161 }
162 Crafting.RegisterCraftingDecider('IA QuickAuctions', isProfitable, QADeciderOptions)
124 163
125 164
126 function ItemAuditor:Queue() 165 function ItemAuditor:Queue()
127 local dest, name = Crafting.GetQueueDestination() 166 local dest, name = Crafting.GetQueueDestination()
128 local function Export(data) 167 local function Export(data)
254 end, 293 end,
255 usage = "###g ##s ##c", 294 usage = "###g ##s ##c",
256 disabled = 'IsQADisabled', 295 disabled = 'IsQADisabled',
257 order = 4, 296 order = 4,
258 }, 297 },
259 header = {
260 type = 'header',
261 name = '',
262 order = 9,
263 },
264 extra = {
265 type = "range",
266 name = "Create Extra",
267 desc = "This is the amount of an item that should be created above what you sell in one post in QuickAuctions."..
268 "If you sell 4 stacks of 5 of an item and your extra is 25%, it will queue enough for you to have 25 of that item.",
269 min = 0.0,
270 max = 1.0,
271 isPercent = true,
272 get = function() return ItemAuditor.db.char.qa_extra end,
273 set = function(info, value)
274 ItemAuditor.db.char.qa_extra = value
275 end,
276 disabled = 'IsQADisabled',
277 order = 10,
278 },
279 refresh_qa = { 298 refresh_qa = {
280 type = "execute", 299 type = "execute",
281 name = "Refresh QA Thresholds", 300 name = "Refresh QA Thresholds",
282 desc = "Resets all Quick Auctions thresholds", 301 desc = "Resets all Quick Auctions thresholds",
283 func = "RefreshQAGroups", 302 func = "RefreshQAGroups",