refactoring and default auction duration setting (this update will delete the history)
This commit is contained in:
+22
-23
@@ -1,14 +1,9 @@
|
||||
module 'aux.core.slash'
|
||||
|
||||
local T = require 'T'
|
||||
local aux = require 'aux'
|
||||
local info = require 'aux.util.info'
|
||||
|
||||
function aux.handle.LOAD2()
|
||||
tooltip_settings = aux.character_data'tooltip'
|
||||
end
|
||||
|
||||
_G.aux_ignore_owner = true
|
||||
_G.aux_crafting_cost = true
|
||||
local post = require 'aux.tabs.post'
|
||||
|
||||
function status(enabled)
|
||||
return (enabled and aux.color.green'on' or aux.color.red'off')
|
||||
@@ -18,20 +13,23 @@ _G.SLASH_AUX1 = '/aux'
|
||||
function SlashCmdList.AUX(command)
|
||||
if not command then return end
|
||||
local arguments = aux.tokenize(command)
|
||||
|
||||
local tooltip_settings = aux.character_data.tooltip
|
||||
if arguments[1] == 'scale' and tonumber(arguments[2]) then
|
||||
local scale = tonumber(arguments[2])
|
||||
aux.frame:SetScale(scale)
|
||||
_G.aux_scale = scale
|
||||
aux.account_data.scale = scale
|
||||
elseif arguments[1] == 'ignore' and arguments[2] == 'owner' then
|
||||
_G.aux_ignore_owner = not aux_ignore_owner
|
||||
aux.print('ignore owner ' .. status(aux_ignore_owner))
|
||||
aux.account_data.ignore_owner = not aux.account_data.ignore_owner
|
||||
aux.print('ignore owner ' .. status(aux.account_data.ignore_owner))
|
||||
elseif arguments[1] == 'post' and arguments[2] == 'bid' then
|
||||
_G.aux_post_bid = not aux_post_bid
|
||||
aux.print('post bid ' .. status(aux_post_bid))
|
||||
elseif arguments[1] == 'crafting' and arguments[2] == 'cost' then
|
||||
_G.aux_crafting_cost = not aux_crafting_cost
|
||||
aux.print('crafting cost ' .. status(aux_crafting_cost))
|
||||
aux.account_data.post_bid = not aux.account_data.post_bid
|
||||
aux.print('post bid ' .. status(aux.account_data.post_bid))
|
||||
elseif arguments[1] == 'post' and arguments[2] == 'duration' and T.map('2', post.DURATION_2, '8', post.DURATION_8, '24', post.DURATION_24)[arguments[3]] then
|
||||
aux.account_data.post_duration = T.map('2', post.DURATION_2, '8', post.DURATION_8, '24', post.DURATION_24)[arguments[3]]
|
||||
aux.print('post duration ' .. aux.color.blue(aux.account_data.post_duration / 60 .. 'h'))
|
||||
elseif arguments[1] == 'crafting' and arguments[2] == 'cost' then
|
||||
aux.account_data.crafting_cost = not aux.account_data.crafting_cost
|
||||
aux.print('crafting cost ' .. status(aux.account_data.crafting_cost))
|
||||
elseif arguments[1] == 'tooltip' and arguments[2] == 'value' then
|
||||
tooltip_settings.value = not tooltip_settings.value
|
||||
aux.print('tooltip value ' .. status(tooltip_settings.value))
|
||||
@@ -51,18 +49,19 @@ function SlashCmdList.AUX(command)
|
||||
tooltip_settings.disenchant_distribution = not tooltip_settings.disenchant_distribution
|
||||
aux.print('tooltip disenchant distribution ' .. status(tooltip_settings.disenchant_distribution))
|
||||
elseif arguments[1] == 'clear' and arguments[2] == 'item' and arguments[3] == 'cache' then
|
||||
_G.aux_items = {}
|
||||
_G.aux_item_ids = {}
|
||||
_G.aux_auctionable_items = {}
|
||||
aux.account_data.items = {}
|
||||
aux.account_data.item_ids = {}
|
||||
aux.account_data.auctionable_items = {}
|
||||
aux.print('Item cache cleared.')
|
||||
elseif arguments[1] == 'populate' and arguments[2] == 'wdb' then
|
||||
info.populate_wdb()
|
||||
else
|
||||
aux.print('Usage:')
|
||||
aux.print('- scale [' .. aux.color.blue(aux_scale) .. ']')
|
||||
aux.print('- ignore owner [' .. status(aux_ignore_owner) .. ']')
|
||||
aux.print('- post bid [' .. status(aux_post_bid) .. ']')
|
||||
aux.print('- crafting cost [' .. status(aux_crafting_cost) .. ']')
|
||||
aux.print('- scale [' .. aux.color.blue(aux.account_data.scale) .. ']')
|
||||
aux.print('- ignore owner [' .. status(aux.account_data.ignore_owner) .. ']')
|
||||
aux.print('- post bid [' .. status(aux.account_data.post_bid) .. ']')
|
||||
aux.print('- post duration [' .. aux.color.blue(aux.account_data.post_duration / 60 .. 'h') .. ']')
|
||||
aux.print('- crafting cost [' .. status(aux.account_data.crafting_cost) .. ']')
|
||||
aux.print('- tooltip value [' .. status(tooltip_settings.value) .. ']')
|
||||
aux.print('- tooltip daily [' .. status(tooltip_settings.daily) .. ']')
|
||||
aux.print('- tooltip merchant buy [' .. status(tooltip_settings.merchant_buy) .. ']')
|
||||
|
||||
Reference in New Issue
Block a user