From 8841f718ca9811972c5414b0249038b7f2ac0fdb Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Wed, 4 Jan 2017 16:14:30 +0100 Subject: [PATCH] changed label for unknown values --- core/tooltip.lua | 10 ++++++---- gui/auction_listing.lua | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/core/tooltip.lua b/core/tooltip.lua index 0f983ea..9aa1dae 100644 --- a/core/tooltip.lua +++ b/core/tooltip.lua @@ -10,6 +10,8 @@ local disenchant = require 'aux.core.disenchant' local history = require 'aux.core.history' local auction_listing = require 'aux.gui.auction_listing' +local UNKNOWN = GRAY_FONT_COLOR_CODE .. '?' .. FONT_COLOR_CODE_CLOSE + _G.aux_tooltip_value = true local game_tooltip_hooks, game_tooltip_money = T, 0 @@ -80,7 +82,7 @@ function extend_tooltip(tooltip, link, quantity) end if aux_tooltip_disenchant_value then local disenchant_value = disenchant.value(item_info.slot, item_info.quality, item_info.level) - tooltip:AddLine('Disenchant Value: ' .. (disenchant_value and money.to_string2(disenchant_value) or GRAY_FONT_COLOR_CODE .. '---' .. FONT_COLOR_CODE_CLOSE), color.tooltip.disenchant.value()) + tooltip:AddLine('Disenchant Value: ' .. (disenchant_value and money.to_string2(disenchant_value) or UNKNOWN), color.tooltip.disenchant.value()) end end end @@ -93,7 +95,7 @@ function extend_tooltip(tooltip, link, quantity) if aux_tooltip_merchant_sell then local price = cache.merchant_info(item_id) if price ~= 0 then - tooltip:AddLine((aux_tooltip_merchant_buy and 'Vendor Sell: ' or 'Vendor: ') .. (price and money.to_string2(price * quantity) or GRAY_FONT_COLOR_CODE .. '---' .. FONT_COLOR_CODE_CLOSE), color.tooltip.merchant()) + tooltip:AddLine((aux_tooltip_merchant_buy and 'Vendor Sell: ' or 'Vendor: ') .. (price and money.to_string2(price * quantity) or UNKNOWN), color.tooltip.merchant()) end end local auctionable = not item_info or info.auctionable(temp-info.tooltip('link', item_info.itemstring), item_info.quality) @@ -101,11 +103,11 @@ function extend_tooltip(tooltip, link, quantity) local value = history.value(item_key) if auctionable then if aux_tooltip_value then - tooltip:AddLine('Value: ' .. (value and money.to_string2(value * quantity) or GRAY_FONT_COLOR_CODE .. '---' .. FONT_COLOR_CODE_CLOSE), color.tooltip.value()) + tooltip:AddLine('Value: ' .. (value and money.to_string2(value * quantity) or UNKNOWN), color.tooltip.value()) end if aux_tooltip_daily then local market_value = history.market_value(item_key) - tooltip:AddLine('Today: ' .. (market_value and money.to_string2(market_value * quantity) .. ' (' .. auction_listing.percentage_historical(round(market_value / value * 100)) .. ')' or GRAY_FONT_COLOR_CODE .. '---' .. FONT_COLOR_CODE_CLOSE), color.tooltip.value()) + tooltip:AddLine('Today: ' .. (market_value and money.to_string2(market_value * quantity) .. ' (' .. auction_listing.percentage_historical(round(market_value / value * 100)) .. ')' or UNKNOWN), color.tooltip.value()) end end diff --git a/gui/auction_listing.lua b/gui/auction_listing.lua index 42141d4..2945412 100644 --- a/gui/auction_listing.lua +++ b/gui/auction_listing.lua @@ -135,7 +135,7 @@ M.search_columns = { width = .04, align = 'CENTER', fill = function(cell, record) - cell.text:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '---') + cell.text:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '?') end, cmp = function(record_a, record_b, desc) return sort_util.compare(record_a.duration, record_b.duration, desc) @@ -146,7 +146,7 @@ M.search_columns = { width = .13, align = 'CENTER', fill = function(cell, record) - cell.text:SetText(is_player(record.owner) and (color.yellow(record.owner)) or (record.owner or '---')) + cell.text:SetText(is_player(record.owner) and (color.yellow(record.owner)) or (record.owner or '?')) end, cmp = function(record_a, record_b, desc) if not record_a.owner and not record_b.owner then @@ -232,7 +232,7 @@ M.search_columns = { align = 'CENTER', fill = function(cell, record) local pct, bidPct = record_percentage(record) - cell.text:SetText((pct or bidPct) and percentage_historical(pct or bidPct, not pct) or '---') + cell.text:SetText((pct or bidPct) and percentage_historical(pct or bidPct, not pct) or '?') end, cmp = function(record_a, record_b, desc) local pct_a = record_percentage(record_a) or (desc and -huge or huge) @@ -302,7 +302,7 @@ M.auctions_columns = { width = .04, align = 'CENTER', fill = function(cell, record) - cell.text:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '---') + cell.text:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '?') end, cmp = function(record_a, record_b, desc) return sort_util.compare(record_a.duration, record_b.duration, desc) @@ -424,7 +424,7 @@ M.bids_columns = { width = .04, align = 'CENTER', fill = function(cell, record) - cell.text:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '---') + cell.text:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '?') end, cmp = function(record_a, record_b, desc) return sort_util.compare(record_a.duration, record_b.duration, desc) @@ -435,7 +435,7 @@ M.bids_columns = { width = .13, align = 'CENTER', fill = function(cell, record) - cell.text:SetText(is_player(record.owner) and (color.yellow(record.owner)) or (record.owner or '---')) + cell.text:SetText(is_player(record.owner) and (color.yellow(record.owner)) or (record.owner or '?')) end, cmp = function(record_a, record_b, desc) if not record_a.owner and not record_b.owner then