refactoring, removed tooltip source

This commit is contained in:
Manuel Simon Hirsig
2017-03-05 02:48:29 +01:00
parent bf613cfa79
commit bf4078afae
16 changed files with 27 additions and 83 deletions
+5 -5
View File
@@ -12,11 +12,11 @@ local MAX_ITEM_ID = 30000
local items_schema = {'tuple', '#', {name='string'}, {quality='number'}, {level='number'}, {class='string'}, {subclass='string'}, {slot='string'}, {max_stack='number'}, {texture='string'}}
local merchant_buy_schema = {'tuple', '#', {unit_price='number'}, {limited='boolean'}}
_G.aux_items = T
_G.aux_item_ids = T
_G.aux_auctionable_items = T
_G.aux_merchant_buy = T
_G.aux_merchant_sell = T
_G.aux_items = {}
_G.aux_item_ids = {}
_G.aux_auctionable_items = {}
_G.aux_merchant_buy = {}
_G.aux_merchant_sell = {}
function LOAD()
scan_wdb()
-36
View File
@@ -7,42 +7,6 @@ local history = require 'aux.core.history'
local UNCOMMON, RARE, EPIC = 2, 3, 4
do
local data = O(
10940, A('DUST', '1-20'),
11083, A('DUST', '21-30'),
11137, A('DUST', '31-40'),
11176, A('DUST', '41-50'),
16204, A('DUST', '51-60'),
10938, A('ESSENCE', '1-10'),
10939, A('ESSENCE', '11-15'),
10998, A('ESSENCE', '16-20'),
11082, A('ESSENCE', '21-25'),
11134, A('ESSENCE', '26-30'),
11135, A('ESSENCE', '31-35'),
11174, A('ESSENCE', '36-40'),
11175, A('ESSENCE', '41-45'),
16202, A('ESSENCE', '46-50'),
16203, A('ESSENCE', '51-60'),
10978, A('SHARD', '1-20'),
11084, A('SHARD', '21-25'),
11138, A('SHARD', '26-30'),
11139, A('SHARD', '31-35'),
11177, A('SHARD', '36-40'),
11178, A('SHARD', '41-45'),
14343, A('SHARD', '46-50'),
14344, A('SHARD', '51-60'),
20725, A('CRYSTAL', '51+')
)
function M.source(item_id)
return unpack(data[item_id] or empty)
end
end
local ARMOR = S(
'INVTYPE_HEAD',
'INVTYPE_NECK',
+1 -1
View File
@@ -7,7 +7,7 @@ local persistence = require 'aux.util.persistence'
local history_schema = {'tuple', '#', {next_push='number'}, {daily_min_buyout='number'}, {data_points={'list', ';', {'tuple', '@', {value='number'}, {time='number'}}}}}
local value_cache = T
local value_cache = {}
do
local cache
+1 -1
View File
@@ -9,7 +9,7 @@ local history = require 'aux.core.history'
local PAGE_SIZE = 50
do
local scan_states = T
local scan_states = {}
function M.start(params)
local old_state = scan_states[params.type]
+3 -8
View File
@@ -1,6 +1,5 @@
module 'aux.core.slash'
include 'T'
include 'aux'
local cache = require 'aux.core.cache'
@@ -44,13 +43,10 @@ function SlashCmdList.AUX(command)
elseif arguments[1] == 'tooltip' and arguments[2] == 'disenchant' and arguments[3] == 'distribution' then
_G.aux_tooltip_disenchant_distribution = not aux_tooltip_disenchant_distribution
print('tooltip disenchant distribution ' .. status(aux_tooltip_disenchant_distribution))
elseif arguments[1] == 'tooltip' and arguments[2] == 'disenchant' and arguments[3] == 'source' then
_G.aux_tooltip_disenchant_source = not aux_tooltip_disenchant_source
print('tooltip disenchant source ' .. status(aux_tooltip_disenchant_source))
elseif arguments[1] == 'clear' and arguments[2] == 'item' and arguments[3] == 'cache' then
_G.aux_items = T
_G.aux_item_ids = T
_G.aux_auctionable_items = T
_G.aux_items = {}
_G.aux_item_ids = {}
_G.aux_auctionable_items = {}
print('Item cache cleared.')
elseif arguments[1] == 'populate' and arguments[2] == 'wdb' then
cache.populate_wdb()
@@ -65,7 +61,6 @@ function SlashCmdList.AUX(command)
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
+1 -14
View File
@@ -14,7 +14,7 @@ local UNKNOWN = GRAY_FONT_COLOR_CODE .. '?' .. FONT_COLOR_CODE_CLOSE
_G.aux_tooltip_value = true
local game_tooltip_hooks, game_tooltip_money = T, 0
local game_tooltip_hooks, game_tooltip_money = {}, 0
function LOAD()
do
@@ -55,19 +55,6 @@ end
function M.extend_tooltip(tooltip, link, quantity)
local item_id, suffix_id = info.parse_link(link)
quantity = IsShiftKeyDown() and quantity or 1
if aux_tooltip_disenchant_source then
local r, g, b = color.tooltip.disenchant.source()
local type, range = disenchant.source(item_id)
if type == 'CRYSTAL' then
tooltip:AddLine(format('Can disenchant from level %s |cffa335eeEpic|r and |cff0070ddRare|r items.', range), r, g, b, true)
elseif type == 'SHARD' then
tooltip:AddLine(format('Can disenchant from level %s |cff0070ddRare|r and |cff1eff00Uncommon|r items.', range), r, g, b, true)
elseif type == 'ESSENCE' then
tooltip:AddLine(format('Can disenchant from level %s |cff1eff00Uncommon|r items.', range), r, g, b, true)
elseif type == 'DUST' then
tooltip:AddLine(format('Can disenchant from level %s |cff1eff00Uncommon|r items.', range), r, g, b, true)
end
end
local item_info = temp-info.item(item_id)
if item_info then
local distribution = disenchant.distribution(item_info.slot, item_info.quality, item_info.level)