big refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-17 17:26:45 +02:00
parent 3624c8c4c0
commit 6796fc1784
13 changed files with 106 additions and 113 deletions
+10 -10
View File
@@ -4,24 +4,24 @@ function SlashCmdList.AUX(command)
local arguments = aux.util.tokenize(command)
if arguments[1] == 'clear' and arguments[2] == 'history' then
aux.persistence.load_dataset().history = nil
aux.log('History cleared.')
aux.log 'History cleared.'
elseif arguments[1] == 'clear' and arguments[2] == 'post' then
aux.persistence.load_dataset().post = nil
aux.log('Post settings cleared.')
aux.log 'Post settings cleared.'
elseif arguments[1] == 'clear' and arguments[2] == 'datasets' then
aux_datasets = {}
aux.log('Datasets cleared.')
aux.log 'Datasets cleared.'
elseif arguments[1] == 'clear' and arguments[2] == 'merchant' and arguments[3] == 'buy' then
aux_merchant_buy = {}
aux.log('Merchant buy prices cleared.')
aux.log 'Merchant buy prices cleared.'
elseif arguments[1] == 'clear' and arguments[2] == 'merchant' and arguments[3] == 'sell' then
aux_merchant_sell = {}
aux.log('Merchant sell prices cleared.')
aux.log 'Merchant sell prices cleared.'
elseif arguments[1] == 'clear' and arguments[2] == 'item' and arguments[3] == 'cache' then
aux_items = {}
aux_item_ids = {}
aux_auctionable_items = {}
aux.log('Item cache cleared.')
aux.log 'Item cache cleared.'
elseif arguments[1] == 'populate' and arguments[2] == 'wdb' then
aux.cache.populate_wdb()
elseif arguments[1] == 'tooltip' and arguments[2] == 'value' then
@@ -49,7 +49,7 @@ function SlashCmdList.AUX(command)
aux_ignore_owner = not aux_ignore_owner
aux.log('Ignoring of owner '..(aux_ignore_owner and 'enabled' or 'disabled')..'.')
elseif arguments[1] == 'chars' and arguments[2] == 'add' then
local realm = GetCVar('realmName')
local realm = GetCVar 'realmName'
aux_characters[realm] = aux_characters[realm] or {}
for i=3,getn(arguments) do
local name = string.gsub(strlower(arguments[i]), '^%l', strupper)
@@ -59,7 +59,7 @@ function SlashCmdList.AUX(command)
end
end
elseif arguments[1] == 'chars' and arguments[2] == 'remove' then
local realm = GetCVar('realmName')
local realm = GetCVar 'realmName'
if not aux_characters[realm] then
return
end
@@ -71,7 +71,7 @@ function SlashCmdList.AUX(command)
end
end
elseif arguments[1] == 'chars' then
local realm = GetCVar('realmName')
local realm = GetCVar 'realmName'
local chars = {}
for name, _ in aux_characters[realm] or {} do
tinsert(chars, name)
@@ -79,7 +79,7 @@ function SlashCmdList.AUX(command)
if getn(chars) > 0 then
aux.log('Your characters: "'..table.concat(chars, ', ')..'".')
else
aux.log('You don\'t have any additional characters. To add your characters type "/aux chars add NAME1 NAME2 NAME3...".')
aux.log 'You don\'t have any additional characters. To add your characters type "/aux chars add NAME1 NAME2 NAME3...".'
end
else
aux.log('Unknown command: "'..command..'"')
+20 -17
View File
@@ -50,12 +50,17 @@ do
end,
}
function public.temp(object)
local env = getfenv(2)
env.__ = object
return env.__(object)
getfenv(2).__ = object
return object
end
end
-- function public.temp(object)
-- local env = getfenv(2)
-- env.__ = object
-- return object
-- end
function public.L(body_string)
return loadstring 'function()'
end
@@ -68,7 +73,7 @@ function public.tab(index, name)
return tab == m.active_tab()
end
for _, handler in {'OPEN', 'CLOSE', 'CLICK_LINK', 'USE_ITEM'} do
module_env.private[handler] = 5
module_env.private[handler] = nil
end
m.tabs[index] = tab
end
@@ -79,11 +84,11 @@ do
end)
function private.on_tab_click(index)
if active_tab_index then
m.call(m.active_tab.env.CLOSE)
m.call(m.active_tab.env.m.CLOSE)
end
active_tab_index = index
if active_tab_index then
m.call(m.active_tab.env.OPEN)
m.call(m.active_tab.env.m.OPEN)
end
end
end
@@ -122,10 +127,10 @@ function public.VARIABLES_LOADED()
end
do
local tabs = m.gui.tabs(m.frame, 'DOWN')
tabs._on_select = m.on_tab_click
for _, tab in m.tabs do
tabs:create_tab(tab.name)
end
tabs._on_select = m.on_tab_click
function public.set_tab(id)
tabs:select(id)
end
@@ -305,7 +310,7 @@ function private.SetItemRef(...)
return m.orig.SetItemRef(unpack(arg))
end
for item_info in aux.util.present(m.info.item(tonumber(({strfind(arg[1], '^item:(%d+)')})[3]))) do
return m.active_tab.env.CLICK_LINK(item_info)
return m.active_tab.env.m.CLICK_LINK(item_info)
end
end
@@ -314,7 +319,7 @@ function private.UseContainerItem(...)
return m.orig.UseContainerItem(unpack(arg))
end
for _, item_info in {m.info.container_item(arg[1], arg[2])} do
return m.active_tab.env.USE_ITEM(item_info)
return m.active_tab.env.m.USE_ITEM(item_info)
end
end
@@ -373,7 +378,7 @@ do
end
end
public.this = {}
public._this = {}
do
local formal_parameters = {}
for i=1,9 do
@@ -384,7 +389,7 @@ do
local function call(f, arg1, arg2)
local params = {}
for i=1,arg1.n do
if arg1[i] == m.this then
if arg1[i] == m._this then
tinsert(params, this)
elseif formal_parameters[arg1[i]] then
tinsert(params, arg2[formal_parameters[arg1[i]]])
@@ -410,9 +415,7 @@ end
function public.index(t, ...)
for i=1,arg.n do
if t then
t = t[arg[i]]
end
t = t and t[arg[i]]
end
return t
end
@@ -428,8 +431,8 @@ function public.log(...)
end
function public.is_player(name, current)
local realm = GetCVar('realmName')
return not current and m.index(aux_characters, realm, name) or UnitName('player') == name
local realm = GetCVar 'realmName'
return not current and m.index(aux_characters, realm, name) or UnitName 'player' == name
end
function public.modified()
@@ -437,7 +440,7 @@ function public.modified()
end
function public.neutral_faction()
return not UnitFactionGroup('npc')
return not UnitFactionGroup 'npc'
end
function public.min_bid_increment(current_bid)
+3 -3
View File
@@ -369,9 +369,9 @@ function public.editbox(parent)
editbox:SetFont(m.config.font, m.config.medium_font_size)
editbox:SetShadowColor(0, 0, 0, 0)
m.set_content_style(editbox)
editbox:SetScript('OnEditFocusGained', aux._(editbox.HighlightText, aux.this))
editbox:SetScript('OnEditFocusLost', aux._(editbox.HighlightText, aux.this, 0, 0))
editbox:SetScript('OnEscapePressed', aux._(editbox.ClearFocus, aux.this))
editbox:SetScript('OnEditFocusGained', aux._(editbox.HighlightText, aux._this))
editbox:SetScript('OnEditFocusLost', aux._(editbox.HighlightText, aux._this, 0, 0))
editbox:SetScript('OnEscapePressed', aux._(editbox.ClearFocus, aux._this))
do
local last_click
editbox:SetScript('OnMouseDown', function()
+3 -3
View File
@@ -25,7 +25,7 @@ function public.module(path)
setfenv(2, env)
end
local event_frame = CreateFrame('Frame')
local event_frame = CreateFrame 'Frame'
for _, event in {'VARIABLES_LOADED', 'ADDON_LOADED', 'AUCTION_HOUSE_SHOW', 'AUCTION_HOUSE_CLOSED', 'AUCTION_BIDDER_LIST_UPDATE', 'AUCTION_OWNED_LIST_UPDATE'} do
event_frame:RegisterEvent(event)
end
@@ -39,8 +39,8 @@ event_frame:SetScript('OnEvent', function()
m[event]()
if event == 'VARIABLES_LOADED' then
for _, env in m.module_envs do
if env.LOAD then
env.LOAD()
if env.m.LOAD then
env.m.LOAD()
end
end
m.log('v'..m.version..' loaded.')
+3
View File
@@ -17,6 +17,9 @@ local interface_mt = {
return state[self].data[key]
end,
__newindex = function(self, key, value)
if type(value) == 'string' then
aux.log('kek', debugstack(1, 0, 5))
end
if state[self].type == PUBLIC then
error('Unsupported operation.', 2)
elseif not state[self].access[PRIVATE][key] then
+41 -53
View File
@@ -4,27 +4,19 @@ local RT_COUNT = 1
local HEAD_HEIGHT = 27
local HEAD_SPACE = 2
public.colors = {
BLUE = '|cff2992ff',
GREEN = '|cff16ff16',
YELLOW = '|cffffff00',
ORANGE = '|cffff9218',
RED = '|cffff0000',
GRAY = '|cffbbbbbb',
local AUCTION_PCT_COLORS = {
{color=aux.gui.inline_color.blue, value=50},
{color=aux.gui.inline_color.green, value=80},
{color=aux.gui.inline_color.yellow, value=110},
{color=aux.gui.inline_color.orange, value=135},
{color=aux.gui.inline_color.red, value=aux.huge},
}
local AUCTION_PCT_COLORS = {
{color=m.colors.BLUE, value=50},
{color=m.colors.GREEN, value=80},
{color=m.colors.YELLOW, value=110},
{color=m.colors.ORANGE, value=135},
{color=m.colors.RED, value=aux.huge},
}
local TIME_LEFT_STRINGS = {
m.colors.RED..'30m'..FONT_COLOR_CODE_CLOSE, -- Short
m.colors.ORANGE..'2h'..FONT_COLOR_CODE_CLOSE, -- Medium
m.colors.YELLOW..'8h'..FONT_COLOR_CODE_CLOSE, -- Long
m.colors.BLUE..'24h'..FONT_COLOR_CODE_CLOSE, -- Very Long
aux.gui.color.red '30m', -- Short
aux.gui.color.orange '2h', -- Medium
aux.gui.color.yellow '8h', -- Long
aux.gui.color.blue '24h', -- Very Long
}
function private.item_column_init(rt, cell)
@@ -84,7 +76,7 @@ public.search_config = {
align = 'CENTER',
set = function(cell, record)
local display_level = max(record.level, 1)
display_level = UnitLevel('player') < record.level and m.colors.RED..display_level..FONT_COLOR_CODE_CLOSE or display_level
display_level = UnitLevel('player') < record.level and aux.gui.color.red(display_level) or display_level
cell:SetText(display_level)
end,
cmp = function(record_a, record_b, desc)
@@ -96,9 +88,9 @@ public.search_config = {
width = 0.06,
align = 'CENTER',
set = function(cell, record, count, own, expandable)
local numAuctionsText = expandable and aux.gui.inline_color.link..count..FONT_COLOR_CODE_CLOSE or count
local numAuctionsText = expandable and aux.gui.color.link(count) or count
if own > 0 then
numAuctionsText = numAuctionsText..(' '..m.colors.YELLOW..'('..own..')'..FONT_COLOR_CODE_CLOSE)
numAuctionsText = numAuctionsText..(' '..aux.gui.color.yellow('('..own..')'))
end
cell:SetText(numAuctionsText)
end,
@@ -142,7 +134,7 @@ public.search_config = {
width = 0.13,
align = 'CENTER',
set = function(cell, record)
cell:SetText(aux.is_player(record.owner) and (m.colors.YELLOW..record.owner..FONT_COLOR_CODE_CLOSE) or (record.owner or '---'))
cell:SetText(aux.is_player(record.owner) and (aux.gui.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
@@ -254,7 +246,7 @@ public.auctions_config = {
align = 'CENTER',
set = function(cell, record)
local display_level = max(record.level, 1)
display_level = UnitLevel('player') < record.level and m.colors.RED..display_level..FONT_COLOR_CODE_CLOSE or display_level
display_level = UnitLevel('player') < record.level and aux.gui.color.red(display_level) or display_level
cell:SetText(display_level)
end,
cmp = function(record_a, record_b, desc)
@@ -357,7 +349,7 @@ public.auctions_config = {
width = 0.21,
align = 'CENTER',
set = function(cell, record)
cell:SetText(record.high_bidder or m.colors.RED..'No Bids'..FONT_COLOR_CODE_CLOSE)
cell:SetText(record.high_bidder or aux.gui.color.red 'No Bids')
end,
cmp = function(record_a, record_b, desc)
if not record_a.high_bidder and not record_b.high_bidder then
@@ -443,7 +435,7 @@ public.bids_config = {
width = 0.13,
align = 'CENTER',
set = function(cell, record)
cell:SetText(aux.is_player(record.owner) and (m.colors.YELLOW..record.owner..FONT_COLOR_CODE_CLOSE) or (record.owner or '---'))
cell:SetText(aux.is_player(record.owner) and (aux.gui.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
@@ -512,9 +504,9 @@ public.bids_config = {
set = function(cell, record)
local status
if record.high_bidder then
status = m.colors.YELLOW..'High Bidder'..FONT_COLOR_CODE_CLOSE
status = aux.gui.color.yellow 'High Bidder'
else
status = m.colors.RED..'Outbid'..FONT_COLOR_CODE_CLOSE
status = aux.gui.color.red 'Outbid'
end
cell:SetText(status)
end,
@@ -545,7 +537,7 @@ function private.percentage_color(pct)
end
function public.percentage_historical(pct, bid)
return (bid and m.colors.GRAY or m.percentage_color(pct))..(pct > 10000 and '>10000' or pct)..'%'..FONT_COLOR_CODE_CLOSE
return (bid and aux.gui.inline_color.gray or m.percentage_color(pct))..(pct > 10000 and '>10000' or pct)..'%'..FONT_COLOR_CODE_CLOSE
end
function public.time_left(code)
@@ -554,16 +546,13 @@ end
local methods = {
OnContentSizeChanged = function()
local width = arg1
local rt = this:GetParent()
for _, cell in rt.headCells do
OnContentSizeChanged = function(self, width)
for _, cell in self.headCells do
cell:SetWidth(cell.info.width * width)
end
for _, row in rt.rows do
for _, row in self.rows do
for i, cell in row.cells do
cell:SetWidth(rt.headCells[i].info.width * width)
cell:SetWidth(self.headCells[i].info.width * width)
end
end
end,
@@ -739,17 +728,17 @@ local methods = {
-- update sorting highlights
for _, cell in self.headCells do
local tex = cell:GetNormalTexture()
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
tex:SetTexCoord(0.017, 1, 0.083, 0.909)
tex:SetTexture [[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(0.5)
end
if getn(self.sorts) > 0 then
local last_sort = self.sorts[1]
if last_sort.descending then
self.headCells[last_sort.index]:GetNormalTexture():SetTexture(0.8, 0.6, 1, 0.8)
self.headCells[last_sort.index]:GetNormalTexture():SetTexture(.8, .6, 1, .8)
else
self.headCells[last_sort.index]:GetNormalTexture():SetTexture(0.6, 0.8, 1, 0.8)
self.headCells[last_sort.index]:GetNormalTexture():SetTexture(.6, .8, 1, .8)
end
end
@@ -1069,8 +1058,8 @@ function public.CreateAuctionResultsTable(parent, config)
cell:SetScript('OnClick', rt.OnHeadColumnClick)
local text = cell:CreateFontString()
text:SetJustifyH('CENTER')
text:SetJustifyV('CENTER')
text:SetJustifyH 'CENTER'
text:SetJustifyV 'CENTER'
text:SetFont(aux.gui.config.font, 12)
text:SetTextColor(unpack(aux.gui.color.label.enabled))
cell:SetFontString(text)
@@ -1079,16 +1068,16 @@ function public.CreateAuctionResultsTable(parent, config)
local tex = cell:CreateTexture()
tex:SetAllPoints()
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
tex:SetTexCoord(0.017, 1, 0.083, 0.909)
tex:SetAlpha(0.5)
tex:SetTexture [[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(.5)
cell:SetNormalTexture(tex)
local tex = cell:CreateTexture()
tex:SetAllPoints()
tex:SetTexture([[Interface\Buttons\UI-Listbox-Highlight]])
tex:SetTexCoord(0.025, 0.957, 0.087, 0.931)
tex:SetAlpha(0.2)
tex:SetTexture [[Interface\Buttons\UI-Listbox-Highlight]]
tex:SetTexCoord(.025, .957, .087, .931)
tex:SetAlpha(.2)
cell:SetHighlightTexture(tex)
tinsert(rt.headCells, cell)
@@ -1119,7 +1108,7 @@ function public.CreateAuctionResultsTable(parent, config)
local text = cell:CreateFontString()
text:SetFont(aux.gui.config.font, min(14, rt.ROW_HEIGHT))
text:SetJustifyH(rt.config[j].align or 'LEFT')
text:SetJustifyV('CENTER')
text:SetJustifyV 'CENTER'
text:SetPoint('TOPLEFT', 1, -1)
text:SetPoint('BOTTOMRIGHT', -1, 1)
cell:SetFontString(text)
@@ -1142,7 +1131,7 @@ function public.CreateAuctionResultsTable(parent, config)
if mod(j,2) == 1 then
local tex = cell:CreateTexture()
tex:SetAllPoints()
tex:SetTexture(0.3, 0.3, 0.3, 0.2)
tex:SetTexture(.3, .3, .3, .2)
cell:SetNormalTexture(tex)
end
@@ -1157,15 +1146,14 @@ function public.CreateAuctionResultsTable(parent, config)
if mod(i,2) == 0 then
local tex = row:CreateTexture()
tex:SetAllPoints()
tex:SetTexture(0.3, 0.3, 0.3, 0.3)
tex:SetTexture(.3, .3, .3, .3)
end
tinsert(rt.rows, row)
end
rt:SetAllPoints()
this = contentFrame -- TODO change, maybe use for resize without scrollbar?
arg1 = contentFrame:GetWidth()
rt:OnContentSizeChanged()
--TODO change, maybe use for resize without scrollbar?
rt:OnContentSizeChanged(contentFrame:GetWidth())
return rt
end
+1 -1
View File
@@ -1,5 +1,5 @@
aux.module 'auctions_tab'
aux.tab(3, 'Auctions', 'auctions_tab')
aux.tab(3, 'Auctions')
private.auction_records = nil
+1 -1
View File
@@ -1,5 +1,5 @@
aux.module 'bids_tab'
aux.tab(4, 'Bids', 'bids_tab')
aux.tab(4, 'Bids')
private.auction_records = nil
+14 -14
View File
@@ -1,5 +1,5 @@
aux.module 'post_tab'
aux.tab(2, 'Post', 'post_tab')
aux.tab(2, 'Post')
local DURATION_4, DURATION_8, DURATION_24 = 120, 480, 1440
local settings_schema = {'record', '#', {stack_size='number'}, {duration='number'}, {start_price='number'}, {buyout_price='number'}, {hidden='boolean'}}
@@ -123,31 +123,31 @@ function private.update_auction_listing()
local bid_color
if blizzard_bid_undercut < unit_start_price and stack_blizzard_bid_undercut < unit_start_price then
bid_color = aux.auction_listing.colors.RED
bid_color = aux.gui.inline_color.red
elseif blizzard_bid_undercut < unit_start_price then
bid_color = aux.auction_listing.colors.ORANGE
bid_color = aux.gui.inline_color.orange
elseif stack_blizzard_bid_undercut < unit_start_price then
bid_color = aux.auction_listing.colors.YELLOW
bid_color = aux.gui.inline_color.yellow
end
local buyout_color
if buyout_price_undercut < unit_buyout_price and stack_buyout_price_undercut < unit_buyout_price then
buyout_color = aux.auction_listing.colors.RED
buyout_color = aux.gui.inline_color.red
elseif buyout_price_undercut < unit_buyout_price then
buyout_color = aux.auction_listing.colors.ORANGE
buyout_color = aux.gui.inline_color.orange
elseif stack_buyout_price_undercut < unit_buyout_price then
buyout_color = aux.auction_listing.colors.YELLOW
buyout_color = aux.gui.inline_color.yellow
end
tinsert(auction_rows, {
cols = {
{ value=auction_record.own and aux.auction_listing.colors.GREEN..auction_record.count..FONT_COLOR_CODE_CLOSE or auction_record.count },
{ value=aux.auction_listing.time_left(auction_record.duration) },
{ value=auction_record.stack_size == stack_size and aux.auction_listing.colors.GREEN..auction_record.stack_size..FONT_COLOR_CODE_CLOSE or auction_record.stack_size },
{ value=aux.money.to_string(auction_record.unit_blizzard_bid, true, nil, 3, bid_color) },
{ value=historical_value and aux.auction_listing.percentage_historical(aux.util.round(auction_record.unit_blizzard_bid / historical_value * 100)) or '---' },
{ value=auction_record.unit_buyout_price > 0 and aux.money.to_string(auction_record.unit_buyout_price, true, nil, 3, buyout_color) or '---' },
{ value=auction_record.unit_buyout_price > 0 and historical_value and aux.auction_listing.percentage_historical(aux.util.round(auction_record.unit_buyout_price / historical_value * 100)) or '---' },
{value=auction_record.own and aux.gui.color.yellow(auction_record.count) or auction_record.count},
{value=aux.auction_listing.time_left(auction_record.duration)},
{value=auction_record.stack_size == stack_size and aux.gui.color.yellow(auction_record.stack_size) or auction_record.stack_size},
{value=aux.money.to_string(auction_record.unit_blizzard_bid, true, nil, 3, bid_color) },
{value=historical_value and aux.auction_listing.percentage_historical(aux.util.round(auction_record.unit_blizzard_bid / historical_value * 100)) or '---'},
{value=auction_record.unit_buyout_price > 0 and aux.money.to_string(auction_record.unit_buyout_price, true, nil, 3, buyout_color) or '---'},
{value=auction_record.unit_buyout_price > 0 and historical_value and aux.auction_listing.percentage_historical(aux.util.round(auction_record.unit_buyout_price / historical_value * 100)) or '---'},
},
record = auction_record,
})
+2 -3
View File
@@ -1,5 +1,5 @@
aux.module 'search_tab'
aux.tab(1, 'Search', 'search_tab')
aux.tab(1, 'Search')
StaticPopupDialogs['AUX_SEARCH_TABLE_FULL'] = {
text = 'Table full!\nFurther results from this search will still be processed but no longer displayed in the table.',
@@ -54,12 +54,11 @@ function m.LOAD()
m.create_frames()
m.update_tab(m.SAVED)
m.update_auto_buy_filter()
m.new_search('')
m.new_search ''
m.current_search().placeholder = true
end
function m.OPEN()
aux.log('kek2')
m.frame:Show()
m.update_search_listings()
end
+1 -1
View File
@@ -237,7 +237,7 @@ function private.create_frames()
btn:SetPoint('RIGHT', m.start_button, 'LEFT', -4, 0)
btn:SetWidth(70)
btn:SetHeight(25)
btn:SetText(aux.auction_listing.colors.GREEN..'Resume'..FONT_COLOR_CODE_CLOSE)
btn:SetText(aux.gui.color.green 'Resume')
btn:SetScript('OnClick', function()
m.execute(true)
end)
+5 -5
View File
@@ -286,9 +286,9 @@ function public.parse_query_string(str)
local i = 1
while parts[i] do
if aux.temp(m.operator(parts[i])) then
tinsert(post_filter, __.operator)
elseif __(m.filters[parts[i]]) then
local input_type = __.filter.input_type
tinsert(post_filter, __)
elseif aux.temp(m.filters[parts[i]]) then
local input_type = __.input_type
if input_type ~= '' then
if not parts[i + 1] or not m.parse_parameter(input_type, parts[i + 1]) then
if parts[i] == 'item' then
@@ -511,8 +511,8 @@ function private.blizzard_query(components)
local query = {name=filters.name and filters.name[2]}
local item_info, class_index, subclass_index, slot_index
if filters.exact and aux.temp(aux.cache.item_id(filters.name[2])) and __(aux.info.item(__.item_id)) then
item_info = __.item_info
if filters.exact and aux.temp(aux.cache.item_id(filters.name[2])) and aux.temp(aux.info.item(__)) then
item_info = __
class_index = aux.info.item_class_index(item_info.class)
subclass_index = aux.info.item_subclass_index(class_index or 0, item_info.subclass)
slot_index = aux.info.item_slot_index(class_index or 0, subclass_index or 0, item_info.slot)
+2 -2
View File
@@ -113,8 +113,8 @@ function public.to_string(money, pad, trim, decimal_points, color, no_color)
end
function public.from_string(value)
if aux.temp(tonumber(value)) and __.number >= 0 then
return __.number * m.COPPER_PER_GOLD
if aux.temp(tonumber(value)) and __ >= 0 then
return __ * m.COPPER_PER_GOLD
end
-- remove any colors