Mercurial > wow > itemauditor
comparison Modules/AuctionHouse.lua @ 90:fab2c4341602
Added options when using Auctioneer to use the market price instead of the lowest price on the AH.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Wed, 11 Aug 2010 00:09:16 -0700 |
parents | 54b917340283 |
children | 693f664aad2b |
comparison
equal
deleted
inserted
replaced
89:54b917340283 | 90:fab2c4341602 |
---|---|
34 end | 34 end |
35 | 35 |
36 return ItemAuditor.db.profile.auction_addon | 36 return ItemAuditor.db.profile.auction_addon |
37 end | 37 end |
38 | 38 |
39 local function setAddon(info, value) | |
40 ItemAuditor.db.profile.auction_addon = value | |
41 end | |
42 | |
43 local function getPricingMethods() | |
44 if ItemAuditor.db.profile.auction_addon == 'other' then | |
45 return { | |
46 low = 'Lowest Price', | |
47 } | |
48 else | |
49 return { | |
50 low = 'Lowest Price', | |
51 market = 'Market Price', | |
52 } | |
53 end | |
54 end | |
55 | |
39 ItemAuditor.Options.args.auction_house = { | 56 ItemAuditor.Options.args.auction_house = { |
40 name = "Auction House", | 57 name = "Auction House", |
41 type = 'group', | 58 type = 'group', |
42 args = { | 59 args = { |
43 ah_addon = { | 60 ah_addon = { |
44 type = "select", | 61 type = "select", |
45 name = "Addon", | 62 name = "Addon", |
46 desc = "", | 63 desc = "", |
47 values = getAddons, | 64 values = getAddons, |
48 get = getSelected, | 65 get = getSelected, |
49 set = function(info, value) ItemAuditor.db.profile.auction_addon = value end, | 66 set = setAddon, |
50 order = 0, | 67 order = 0, |
51 }, | 68 }, |
69 pricingMethod = { | |
70 type = "select", | |
71 name = "Pricing Method", | |
72 desc = "", | |
73 values = getPricingMethods, | |
74 get = function() return ItemAuditor.db.profile.pricing_method end, | |
75 set = function(info, value) ItemAuditor.db.profile.pricing_method = value end, | |
76 order = 1, | |
77 } | |
52 }, | 78 }, |
53 } | 79 } |
54 | 80 |
55 function AuctionHouse:GetAuctionPrice(itemLink) | 81 function AuctionHouse:GetAuctionPrice(itemLink) |
56 local link = select(2, GetItemInfo(itemLink)) | 82 local link = select(2, GetItemInfo(itemLink)) |
57 assert(link, 'Invalid item link: '..itemLink) | 83 assert(link, 'Invalid item link: '..itemLink) |
58 local addon = getSelected() | 84 local addon = getSelected() |
85 local prices = ItemAuditor.db.profile.pricing_method or 'low' | |
59 if GetAuctionBuyout ~= nil and addon == 'other' then | 86 if GetAuctionBuyout ~= nil and addon == 'other' then |
60 return GetAuctionBuyout(link) | 87 return GetAuctionBuyout(link) |
61 elseif AucAdvanced and AucAdvanced.Version and addon == 'auctioneer' then | 88 elseif AucAdvanced and AucAdvanced.Version and addon == 'auctioneer' then |
62 local _, _, _, _, _, lowBuy= AucAdvanced.Modules.Util.SimpleAuction.Private.GetItems(link) | 89 if prices == 'low' then |
63 return lowBuy | 90 local _, _, _, _, _, lowBuy= AucAdvanced.Modules.Util.SimpleAuction.Private.GetItems(link) |
91 return lowBuy | |
92 else | |
93 return AucAdvanced.API.GetMarketValue(link) | |
94 end | |
64 end | 95 end |
65 return nil | 96 return nil |
66 end | 97 end |