slash refactoring, usage printout
This commit is contained in:
+20
-6
@@ -7,6 +7,10 @@ local cache = require 'aux.core.cache'
|
||||
|
||||
_G.aux_ignore_owner = true
|
||||
|
||||
function status(enabled)
|
||||
return '[' .. (enabled and color.green'on' or color.red'off') .. ']'
|
||||
end
|
||||
|
||||
_G.SLASH_AUX1 = '/aux'
|
||||
function SlashCmdList.AUX(command)
|
||||
if not command then return end
|
||||
@@ -25,11 +29,11 @@ function SlashCmdList.AUX(command)
|
||||
_G.aux_tooltip_daily = not aux_tooltip_daily
|
||||
print('Market value in tooltip ' .. (aux_tooltip_daily and 'enabled' or 'disabled') .. '.')
|
||||
elseif arguments[1] == 'tooltip' and arguments[2] == 'vendor' and arguments[3] == 'buy' then
|
||||
_G.aux_tooltip_vendor_buy = not aux_tooltip_vendor_buy
|
||||
print('Vendor buy price in tooltip ' .. (aux_tooltip_vendor_buy and 'enabled' or 'disabled') .. '.')
|
||||
_G.aux_tooltip_merchant_buy = not aux_tooltip_merchant_buy
|
||||
print('Vendor buy price in tooltip ' .. (aux_tooltip_merchant_buy and 'enabled' or 'disabled') .. '.')
|
||||
elseif arguments[1] == 'tooltip' and arguments[2] == 'vendor' and arguments[3] == 'sell' then
|
||||
_G.aux_tooltip_vendor_sell = not aux_tooltip_vendor_sell
|
||||
print('Vendor sell price in tooltip ' .. (aux_tooltip_vendor_sell and 'enabled' or 'disabled') .. '.')
|
||||
_G.aux_tooltip_merchant_sell = not aux_tooltip_merchant_sell
|
||||
print('Vendor sell price in tooltip ' .. (aux_tooltip_merchant_sell and 'enabled' or 'disabled') .. '.')
|
||||
elseif arguments[1] == 'tooltip' and arguments[2] == 'disenchant' and arguments[3] == 'value' then
|
||||
_G.aux_tooltip_disenchant_value = not aux_tooltip_disenchant_value
|
||||
print('Disenchant value in tooltip ' .. (aux_tooltip_disenchant_value and 'enabled' or 'disabled') .. '.')
|
||||
@@ -43,6 +47,16 @@ function SlashCmdList.AUX(command)
|
||||
_G.aux_ignore_owner = not aux_ignore_owner
|
||||
print('Ignoring of owner ' .. (aux_ignore_owner and 'enabled' or 'disabled') .. '.')
|
||||
else
|
||||
print('Unknown command: "' .. command .. '"')
|
||||
end
|
||||
print('Usage:')
|
||||
print(' - ignore owner ' .. status(aux_ignore_owner))
|
||||
print(' - tooltip value ' .. status(aux_tooltip_value))
|
||||
print(' - tooltip daily ' .. status(aux_tooltip_daily))
|
||||
print(' - tooltip vendor buy ' .. status(aux_tooltip_merchant_buy))
|
||||
print(' - tooltip vendor sell ' .. status(aux_tooltip_merchant_sell))
|
||||
print(' - tooltip disenchant value ' .. status(aux_tooltip_disenchant_value))
|
||||
print(' - tooltip disenchant distribution ' .. status(aux_tooltip_disenchant_distribution))
|
||||
print(' - tooltip disenchant source ' .. status(aux_tooltip_disenchant_source))
|
||||
print(' - clear item cache')
|
||||
print(' - populate wdb')
|
||||
end
|
||||
end
|
||||
+2
-2
@@ -84,13 +84,13 @@ function extend_tooltip(tooltip, link, quantity)
|
||||
end
|
||||
end
|
||||
end
|
||||
if aux_tooltip_vendor_buy then
|
||||
if aux_tooltip_merchant_buy then
|
||||
local _, price, limited = cache.merchant_info(item_id)
|
||||
if price then
|
||||
tooltip:AddLine('Vendor Buy ' .. (limited and '(limited): ' or ': ') .. money.to_string2(price * quantity), color.tooltip.merchant())
|
||||
end
|
||||
end
|
||||
if aux_tooltip_vendor_sell then
|
||||
if aux_tooltip_merchant_sell then
|
||||
local price = cache.merchant_info(item_id)
|
||||
if price ~= 0 then
|
||||
tooltip:AddLine('Vendor Sell: ' .. (price and money.to_string2(price * quantity) or GRAY_FONT_COLOR_CODE .. '---' .. FONT_COLOR_CODE_CLOSE), color.tooltip.merchant())
|
||||
|
||||
Reference in New Issue
Block a user