diff --git a/Aux-AddOn.toc b/Aux-AddOn.toc index 9a32b79..6a9003e 100644 --- a/Aux-AddOn.toc +++ b/Aux-AddOn.toc @@ -1,6 +1,6 @@ ## Interface: 11200 ## Title: Aux -## SavedVariablesPerCharacter: aux_recent_searches, aux_favorite_searches, aux_price_per_unit, aux_scale, aux_tooltip_market +## SavedVariablesPerCharacter: aux_recent_searches, aux_favorite_searches, aux_price_per_unit, aux_scale, aux_tooltip_daily ## SavedVariables: aux_database, aux_auctionable_items slash.lua diff --git a/auction_listing.lua b/auction_listing.lua index fe7b448..524a93d 100644 --- a/auction_listing.lua +++ b/auction_listing.lua @@ -18,7 +18,7 @@ local TIME_LEFT_STRINGS = { '|cff2992ff24h|r', -- Very Long } -function public.percentage_market(pct, based_on_bid) +function public.percentage_historical(pct, based_on_bid) local pctColor = '|cffffffff' if based_on_bid then @@ -441,7 +441,7 @@ local methods = { row.cells[7]:SetText(bid > 0 and Aux.money.to_string(bid, true, false, nil, colorBid) or '---') row.cells[8]:SetText(buyout > 0 and Aux.money.to_string(buyout, true, false, nil, colorBuyout) or '---') local pct, bidPct = self:GetRecordPercent(record) - row.cells[9]:SetText((pct or bidPct) and public.percentage_market(pct or bidPct, not pct) or '---') + row.cells[9]:SetText((pct or bidPct) and public.percentage_historical(pct or bidPct, not pct) or '---') end end, diff --git a/auctions_frame.lua b/auctions_frame.lua index 4fbf5c3..b737e28 100644 --- a/auctions_frame.lua +++ b/auctions_frame.lua @@ -70,7 +70,7 @@ function private.update_listing() { value=auction_record.high_bid > 0 and Aux.money.to_string(auction_record.high_bid, true, false) or RED_FONT_COLOR_CODE..'No Bids'..FONT_COLOR_CODE_CLOSE }, { value=Aux.money.to_string(auction_record.start_price, true, false) }, { value=auction_record.buyout_price > 0 and Aux.money.to_string(auction_record.buyout_price, true, false) or '---' }, - -- { value=Aux.auction_listing.percentage_market(market_value and Aux.round(auction_record.unit_buyout_price/market_value * 100) or '---') }, + -- { value=Aux.auction_listing.percentage_historical(market_value and Aux.round(auction_record.unit_buyout_price/market_value * 100) or '---') }, }, record = auction_record, }) diff --git a/bids_frame.lua b/bids_frame.lua index 288437f..70ff286 100644 --- a/bids_frame.lua +++ b/bids_frame.lua @@ -90,7 +90,7 @@ function private.update_listing() { value=auction_record.high_bidder and Aux.money.to_string(auction_record.high_bid, true, false) or '---' }, { value=Aux.money.to_string(auction_record.bid_price, true, false) }, { value=auction_record.buyout_price > 0 and Aux.money.to_string(auction_record.buyout_price, true, false) or '---' }, - -- { value=Aux.auction_listing.percentage_market(market_value and Aux.round(auction_record.unit_buyout_price/market_value * 100) or '---') }, + -- { value=Aux.auction_listing.percentage_historical(market_value and Aux.round(auction_record.unit_buyout_price/market_value * 100) or '---') }, }, record = auction_record, }) diff --git a/core.lua b/core.lua index 4d77ebc..b87f295 100644 --- a/core.lua +++ b/core.lua @@ -1,5 +1,5 @@ Aux = { - version = '2.5.2', + version = '2.5.3', blizzard_ui_shown = false, orig = {}, } @@ -20,19 +20,9 @@ function Aux.on_load() local item_key = (item_id or 0)..':'..(suffix_id or 0) - if aux_tooltip_market then - local market_value = Aux.history.market_value(item_key) - - local market_value_line = 'Mkt. Value: ' - market_value_line = market_value_line..(market_value and EnhTooltip.GetTextGSC(market_value) or '---') - - EnhTooltip.AddLine(market_value_line, nil, true) - EnhTooltip.LineColor(0.1, 0.8, 0.5) - end - local value = Aux.history.value(item_key) - local value_line = aux_tooltip_market and 'Hist. Value: ' or 'Value: ' + local value_line = 'Value: ' value_line = value_line..(value and EnhTooltip.GetTextGSC(value) or '---') @@ -43,6 +33,16 @@ function Aux.on_load() EnhTooltip.AddLine(value_line, nil, true) EnhTooltip.LineColor(0.1, 0.8, 0.5) + + if aux_tooltip_daily then + local market_value = Aux.history.market_value(item_key) + + local market_value_line = 'Today: ' + market_value_line = market_value_line..(market_value and Aux.auction_listing.percentage_historical(Aux.round(market_value / value * 100))..' ('..EnhTooltip.GetTextGSC(market_value)..')' or '---') + + EnhTooltip.AddLine(market_value_line, nil, true) + EnhTooltip.LineColor(0.1, 0.8, 0.5) + end end) end diff --git a/post_frame.lua b/post_frame.lua index 4d1c7ba..baf67ca 100644 --- a/post_frame.lua +++ b/post_frame.lua @@ -53,7 +53,7 @@ function private.update_auction_listing() { value=Aux.auction_listing.time_left(auction_record.duration) }, { value=stack_size }, { value=Aux.money.to_string(auction_record.unit_buyout_price, true, nil, 3) }, - { value=market_value and Aux.auction_listing.percentage_market(Aux.round(auction_record.unit_buyout_price / market_value * 100)) or '---' }, + { value=market_value and Aux.auction_listing.percentage_historical(Aux.round(auction_record.unit_buyout_price / market_value * 100)) or '---' }, }, record = auction_record, }) diff --git a/slash.lua b/slash.lua index a8653eb..2660942 100644 --- a/slash.lua +++ b/slash.lua @@ -11,8 +11,8 @@ function SlashCmdList.AUX(parameter) elseif parameter == 'delete item cache' then aux_auctionable_items = nil Aux.log('Item cache deleted; falling back to the default.') - elseif parameter == 'tooltip market' then - aux_tooltip_market = not aux_tooltip_market - Aux.log('Market value in tooltip '..(aux_tooltip_market and 'enabled' or 'disabled')..'.') + elseif parameter == 'tooltip daily' then + aux_tooltip_daily = not aux_tooltip_daily + Aux.log('Market value in tooltip '..(aux_tooltip_daily and 'enabled' or 'disabled')..'.') end end \ No newline at end of file