diff --git a/components/cache.lua b/components/cache.lua
index 4672e31..239b102 100644
--- a/components/cache.lua
+++ b/components/cache.lua
@@ -16,17 +16,17 @@ g.aux_characters = {}
function LOAD()
scan_wdb()
- aux.control.event_listener('MERCHANT_SHOW', on_merchant_show)
- aux.control.event_listener('MERCHANT_CLOSED', on_merchant_closed)
- aux.control.event_listener('MERCHANT_UPDATE', on_merchant_update)
- aux.control.event_listener('BAG_UPDATE', on_bag_update)
+ control.event_listener('MERCHANT_SHOW', on_merchant_show)
+ control.event_listener('MERCHANT_CLOSED', on_merchant_closed)
+ control.event_listener('MERCHANT_UPDATE', on_merchant_update)
+ control.event_listener('BAG_UPDATE', on_bag_update)
CreateFrame('Frame', nil, MerchantFrame):SetScript('OnUpdate', merchant_on_update)
- aux.control.event_listener('NEW_AUCTION_UPDATE', function()
- for _, info in {aux.info.auction_sell_item()} do
- for _, item_id in {aux.cache.item_id(info.name)} do
- g.aux_merchant_sell[aux.cache.item_id(info.name)] = info.vendor_price / (aux.info.max_item_charges(item_id) or info.count)
+ control.event_listener('NEW_AUCTION_UPDATE', function()
+ for _, info in {info.auction_sell_item()} do
+ for _, item_id in {cache.item_id(info.name)} do
+ g.aux_merchant_sell[cache.item_id(info.name)] = info.vendor_price / (info.max_item_charges(item_id) or info.count)
end
end
end)
@@ -79,7 +79,7 @@ end
function public.merchant_info(item_id)
local buy_info
if g.aux_merchant_buy[item_id] then
- buy_info = aux.persistence.read(merchant_buy_schema, g.aux_merchant_buy[item_id])
+ buy_info = persistence.read(merchant_buy_schema, g.aux_merchant_buy[item_id])
end
return g.aux_merchant_sell[item_id], buy_info and buy_info.unit_price, buy_info and buy_info.limited
@@ -88,7 +88,7 @@ end
function public.item_info(item_id)
local data_string = g.aux_items[item_id]
if data_string then
- local cached_data = aux.persistence.read(items_schema, data_string)
+ local cached_data = persistence.read(items_schema, data_string)
return {
name = cached_data.name,
itemstring = 'item:'..item_id..':0:0:0',
@@ -114,10 +114,10 @@ function merchant_buy_scan()
local _, _, price, count, stock = GetMerchantItemInfo(i)
local link = GetMerchantItemLink(i)
if link then
- local item_id = aux.info.parse_link(link)
+ local item_id = info.parse_link(link)
local new_unit_price, new_limited = price / count, stock >= 0
if g.aux_merchant_buy[item_id] then
- local buy_info = aux.persistence.read(merchant_buy_schema, g.aux_merchant_buy[item_id])
+ local buy_info = persistence.read(merchant_buy_schema, g.aux_merchant_buy[item_id])
local unit_price
if buy_info.limited and not new_limited then
@@ -128,12 +128,12 @@ function merchant_buy_scan()
unit_price = min(buy_info.unit_price, new_unit_price)
end
- g.aux_merchant_buy[item_id] = aux.persistence.write(merchant_buy_schema, {
+ g.aux_merchant_buy[item_id] = persistence.write(merchant_buy_schema, {
unit_price = unit_price,
limited = buy_info.limited and new_limited,
})
else
- g.aux_merchant_buy[item_id] = aux.persistence.write(merchant_buy_schema, {
+ g.aux_merchant_buy[item_id] = persistence.write(merchant_buy_schema, {
unit_price = new_unit_price,
limited = new_limited,
})
@@ -148,7 +148,7 @@ end
function merchant_sell_scan()
for slot in inventory do
- local item_info = aux.info.container_item(unpack(slot))
+ local item_info = info.container_item(unpack(slot))
if item_info then
g.aux_merchant_sell[item_info.item_id] = item_info.tooltip_money / item_info.aux_quantity
end
@@ -164,7 +164,7 @@ function scan_wdb(item_id)
local name, _, quality, level, class, subclass, max_stack, slot, texture = GetItemInfo(itemstring)
if name and not g.aux_item_ids[strlower(name)] then
g.aux_item_ids[strlower(name)] = item_id
- g.aux_items[item_id] = aux.persistence.write(items_schema, {
+ g.aux_items[item_id] = persistence.write(items_schema, {
name = name,
quality = quality,
level = level,
@@ -174,8 +174,8 @@ function scan_wdb(item_id)
max_stack = max_stack,
texture = texture,
})
- local tooltip = aux.info.tooltip(function(tt) tt:SetHyperlink(itemstring) end)
- if aux.info.auctionable(tooltip, quality) then
+ local tooltip = info.tooltip(function(tt) tt:SetHyperlink(itemstring) end)
+ if info.auctionable(tooltip, quality) then
tinsert(g.aux_auctionable_items, strlower(name))
end
processed = processed + 1
@@ -185,7 +185,7 @@ function scan_wdb(item_id)
if item_id <= MAX_ITEM_ID then
local t0 = GetTime()
- aux.control.thread(aux.control.when, function() return GetTime() - t0 > 0.1 end, scan_wdb, item_id)
+ control.thread(control.when, function() return GetTime() - t0 > 0.1 end, scan_wdb, item_id)
else
sort(g.aux_auctionable_items, function(a, b) return strlen(a) < strlen(b) or (strlen(a) == strlen(b) and a < b) end)
end
@@ -204,5 +204,5 @@ function public.populate_wdb(item_id)
AuxTooltip:SetHyperlink('item:'..item_id)
end
- aux.control.thread(populate_wdb, item_id + 1)
+ control.thread(populate_wdb, item_id + 1)
end
\ No newline at end of file
diff --git a/components/disenchant.lua b/components/disenchant.lua
index 7c21b73..d3aac4f 100644
--- a/components/disenchant.lua
+++ b/components/disenchant.lua
@@ -73,7 +73,7 @@ end
function public.value(slot, quality, level)
local expectation
for _, event in m.distribution(slot, quality, level) do
- local value = aux.history.value(event.item_id..':'..0)
+ local value = history.value(event.item_id..':'..0)
if not value then
return
else
diff --git a/components/history.lua b/components/history.lua
index ec6af1a..78bf8b5 100644
--- a/components/history.lua
+++ b/components/history.lua
@@ -14,7 +14,7 @@ function new_record()
end
function load_data()
- local dataset = aux.persistence.load_dataset()
+ local dataset = persistence.load_dataset()
dataset.history = dataset.history or {}
return dataset.history
end
@@ -24,7 +24,7 @@ function read_record(item_key)
local record
if data[item_key] then
- record = aux.persistence.read(history_schema, data[item_key])
+ record = persistence.read(history_schema, data[item_key])
else
record = m.new_record()
end
@@ -40,7 +40,7 @@ end
function write_record(item_key, record)
m.value_cache[item_key] = nil
local data = m.load_data()
- data[item_key] = aux.persistence.write(history_schema, record)
+ data[item_key] = persistence.write(history_schema, record)
end
function public.process_auction(auction_record)
diff --git a/components/post.lua b/components/post.lua
index c472cf7..5e2b668 100644
--- a/components/post.lua
+++ b/components/post.lua
@@ -8,7 +8,7 @@ function process()
local stacking_complete
local send_signal, signal_received = signal()
- aux.control.when(signal_received, function()
+ control.when(signal_received, function()
local slot = signal_received()[1]
if slot then
return m.post_auction(slot, m.process)
@@ -17,15 +17,15 @@ function process()
end
end)
- return aux.stack.start(m.state.item_key, m.state.stack_size, send_signal)
+ return stack.start(m.state.item_key, m.state.stack_size, send_signal)
end
return m.stop()
end
function post_auction(slot, k)
- local item_info = aux.info.container_item(unpack(slot))
- if item_info.item_key == m.state.item_key and aux.info.auctionable(item_info.tooltip) and item_info.aux_quantity == m.state.stack_size then
+ local item_info = info.container_item(unpack(slot))
+ if item_info.item_key == m.state.item_key and info.auctionable(item_info.tooltip) and item_info.aux_quantity == m.state.stack_size then
ClearCursor()
ClickAuctionSellItemButton()
@@ -37,13 +37,13 @@ function post_auction(slot, k)
StartAuction(max(1, round(m.state.unit_start_price * item_info.aux_quantity)), round(m.state.unit_buyout_price * item_info.aux_quantity), m.state.duration)
local send_signal, signal_received = signal()
- aux.control.when(signal_received, function()
+ control.when(signal_received, function()
m.state.posted = m.state.posted + 1
return k()
end)
local posted
- aux.control.event_listener('CHAT_MSG_SYSTEM', function(kill)
+ control.event_listener('CHAT_MSG_SYSTEM', function(kill)
if arg1 == ERR_AUCTION_STARTED then
send_signal()
kill()
@@ -56,7 +56,7 @@ end
function public.stop()
if m.state then
- aux.control.kill_thread(m.state.thread_id)
+ control.kill_thread(m.state.thread_id)
local callback = m.state.callback
local posted = m.state.posted
@@ -72,7 +72,7 @@ end
function public.start(item_key, stack_size, duration, unit_start_price, unit_buyout_price, count, callback)
m.stop()
- local thread_id = aux.control.thread(m.process)
+ local thread_id = control.thread(m.process)
m.state = {
thread_id = thread_id,
diff --git a/components/scan.lua b/components/scan.lua
index f2dd1ed..a7fc8f8 100644
--- a/components/scan.lua
+++ b/components/scan.lua
@@ -9,7 +9,7 @@ do
for _, old_state in {scan_states[params.type]} do
abort(old_state.id)
end
- local thread_id = aux.control.thread(L(wait_for_callback, params.on_scan_start, scan))
+ local thread_id = control.thread(L(wait_for_callback, params.on_scan_start, scan))
scan_states[params.type] = {
id = thread_id,
params = params,
@@ -21,7 +21,7 @@ do
local aborted = {}
for type, state in scan_states do
if not scan_id or state.id == scan_id then
- aux.control.kill_thread(state.id)
+ control.kill_thread(state.id)
scan_states[type] = nil
tinsert(aborted, state)
end
@@ -38,7 +38,7 @@ do
end
function accessor.state()
- local _, state = next(filter(scan_states, function(state) return state.id == aux.control.thread_id end))
+ local _, state = next(filter(scan_states, function(state) return state.id == control.thread_id end))
return state
end
end
@@ -66,7 +66,7 @@ function wait_for_callback(...)
send_signal()
end
- return aux.control.when(signal_received, function() return k(unpack(signal_received())) end)
+ return control.when(signal_received, function() return k(unpack(signal_received())) end)
end
function total_pages(total_auctions)
@@ -102,7 +102,7 @@ function process_query()
end
function submit_query()
- aux.control.when(function() return state.params.type ~= 'list' or CanSendAuctionQuery() end, function()
+ control.when(function() return state.params.type ~= 'list' or CanSendAuctionQuery() end, function()
call(state.params.on_submit_query)
state.last_query_time = GetTime()
if state.params.type == 'bidder' then
@@ -144,20 +144,20 @@ function scan_page(i)
end
end
- local auction_info = aux.info.auction(i, state.params.type)
+ local auction_info = info.auction(i, state.params.type)
if auction_info and (auction_info.owner or state.params.ignore_owner or g.aux_ignore_owner) then
auction_info.index = i
auction_info.page = state.page
auction_info.blizzard_query = query.blizzard_query
auction_info.query_type = state.params.type
- aux.history.process_auction(auction_info)
+ history.process_auction(auction_info)
if call(state.params.auto_buy_validator, auction_info) then
local send_signal, signal_received = signal()
- aux.control.when(signal_received, recurse)
- aux.place_bid(auction_info.query_type, auction_info.index, auction_info.buyout_price, L(send_signal, true))
- return aux.control.thread(aux.control.when, later(GetTime(), 10), L(send_signal, false))
+ control.when(signal_received, recurse)
+ place_bid(auction_info.query_type, auction_info.index, auction_info.buyout_price, L(send_signal, true))
+ return control.thread(control.when, later(GetTime(), 10), L(send_signal, false))
elseif not query.validator or query.validator(auction_info) then
return wait_for_callback(state.params.on_auction, auction_info, function(removed)
if removed then
@@ -175,7 +175,7 @@ end
function wait_for_results()
local timeout = later(state.last_query_time, 10)
local send_signal, signal_received = signal()
- aux.control.when(signal_received, function()
+ control.when(signal_received, function()
if timeout() then
return submit_query()
else
@@ -190,10 +190,10 @@ function wait_for_results()
end
end)
- aux.control.thread(aux.control.when, timeout, send_signal)
+ control.thread(control.when, timeout, send_signal)
if state.params.type == 'bidder' then
- return aux.control.thread(aux.control.when, function() return aux.bids_loaded end, send_signal)
+ return control.thread(control.when, function() return bids_loaded end, send_signal)
elseif state.params.type == 'owner' then
return wait_for_owner_results(send_signal)
elseif state.params.type == 'list' then
@@ -202,22 +202,22 @@ function wait_for_results()
end
function wait_for_owner_results(send_signal)
- if state.page == aux.current_owner_page then
+ if state.page == current_owner_page then
return send_signal()
else
- return aux.control.on_next_event('AUCTION_OWNED_LIST_UPDATE', send_signal)
+ return control.on_next_event('AUCTION_OWNED_LIST_UPDATE', send_signal)
end
end
function wait_for_list_results(send_signal, signal_received)
local updated, last_update
- aux.control.event_listener('AUCTION_ITEM_LIST_UPDATE', function(kill)
+ control.event_listener('AUCTION_ITEM_LIST_UPDATE', function(kill)
kill(signal_received())
last_update = GetTime()
updated = true
end)
local ignore_owner = state.params.ignore_owner or g.aux_ignore_owner
- return aux.control.thread(aux.control.when, function()
+ return control.thread(control.when, function()
-- short circuiting order important, owner_data_complete must be called iif an update has happened.
local ok = updated and (ignore_owner or owner_data_complete('list')) or last_update and GetTime() - last_update > 5
updated = false
@@ -227,7 +227,7 @@ end
function owner_data_complete(type)
for i=1,PAGE_SIZE do
- local auction_info = aux.info.auction(i, type)
+ local auction_info = info.auction(i, type)
if auction_info and not auction_info.owner then
return false
end
diff --git a/components/slash.lua b/components/slash.lua
index ecefc88..2e2657d 100644
--- a/components/slash.lua
+++ b/components/slash.lua
@@ -3,10 +3,10 @@ function SlashCmdList.AUX(command)
if not command then return end
local arguments = tokenize(command)
if arguments[1] == 'clear' and arguments[2] == 'history' then
- aux.persistence.load_dataset().history = nil
+ persistence.load_dataset().history = nil
log 'History cleared.'
elseif arguments[1] == 'clear' and arguments[2] == 'post' then
- aux.persistence.load_dataset().post = nil
+ persistence.load_dataset().post = nil
log 'Post settings cleared.'
elseif arguments[1] == 'clear' and arguments[2] == 'datasets' then
g.aux_datasets = {}
@@ -23,7 +23,7 @@ function SlashCmdList.AUX(command)
g.aux_auctionable_items = {}
log 'Item cache cleared.'
elseif arguments[1] == 'populate' and arguments[2] == 'wdb' then
- aux.cache.populate_wdb()
+ cache.populate_wdb()
elseif arguments[1] == 'tooltip' and arguments[2] == 'value' then
g.aux_tooltip_value = not g.aux_tooltip_value
log('Historical value in tooltip '..(g.aux_tooltip_value and 'enabled' or 'disabled')..'.')
diff --git a/components/stack.lua b/components/stack.lua
index cd2775f..3ea8954 100644
--- a/components/stack.lua
+++ b/components/stack.lua
@@ -3,22 +3,22 @@ aux.module 'stack'
state = nil
function stack_size(slot)
- local container_item_info = aux.info.container_item(unpack(slot))
+ local container_item_info = info.container_item(unpack(slot))
return container_item_info and container_item_info.count or 0
end
function charges(slot)
- local container_item_info = aux.info.container_item(unpack(slot))
+ local container_item_info = info.container_item(unpack(slot))
return container_item_info and container_item_info.charges
end
function max_stack(slot)
- local container_item_info = aux.info.container_item(unpack(slot))
+ local container_item_info = info.container_item(unpack(slot))
return container_item_info and container_item_info.max_stack
end
function locked(slot)
- local container_item_info = aux.info.container_item(unpack(slot))
+ local container_item_info = info.container_item(unpack(slot))
return container_item_info and container_item_info.locked
end
@@ -31,8 +31,8 @@ function find_item_slot(partial)
end
function matching_item(slot, partial)
- local item_info = aux.info.container_item(unpack(slot))
- return item_info and item_info.item_key == m.state.item_key and aux.info.auctionable(item_info.tooltip) and (not partial or item_info.count < item_info.max_stack)
+ local item_info = info.container_item(unpack(slot))
+ return item_info and item_info.item_key == m.state.item_key and info.auctionable(item_info.tooltip) and (not partial or item_info.count < item_info.max_stack)
end
function find_empty_slot()
@@ -53,7 +53,7 @@ end
function move_item(from_slot, to_slot, amount, k)
if m.locked(from_slot) or m.locked(to_slot) then
- return aux.control.wait(k)
+ return control.wait(k)
end
amount = min(m.max_stack(from_slot) - m.stack_size(to_slot), m.stack_size(from_slot), amount)
@@ -63,7 +63,7 @@ function move_item(from_slot, to_slot, amount, k)
SplitContainerItem(from_slot[1], from_slot[2], amount)
PickupContainerItem(unpack(to_slot))
- return aux.control.when(function() return m.stack_size(to_slot) == expected_size end, k)
+ return control.when(function() return m.stack_size(to_slot) == expected_size end, k)
end
function process()
@@ -105,7 +105,7 @@ end
function public.stop()
if m.state then
- aux.control.kill_thread(m.state.thread_id)
+ control.kill_thread(m.state.thread_id)
local callback, slot = m.state.callback, m.state.target_slot
if slot and not m.matching_item(slot) then
slot = nil
@@ -118,7 +118,7 @@ end
function public.start(item_key, size, callback)
m.stop()
- local thread_id = aux.control.thread(m.process)
+ local thread_id = control.thread(m.process)
m.state = {
thread_id = thread_id,
item_key = item_key,
diff --git a/components/tooltip.lua b/components/tooltip.lua
index fe05d69..7618857 100644
--- a/components/tooltip.lua
+++ b/components/tooltip.lua
@@ -9,12 +9,12 @@ game_tooltip_money = nil
function LOAD()
for func, hook in game_tooltip_hooks do
local func, hook = func, hook
- aux.hook(
+ hook(
func,
function(...)
hooked_setter = true
game_tooltip_money = 0
- local results = {aux.orig[GameTooltip][func](unpack(arg)) }
+ local results = {orig[GameTooltip][func](unpack(arg)) }
hooked_setter = false
hook(unpack(arg))
return unpack(results)
@@ -44,13 +44,13 @@ function LOAD()
end
function extend_tooltip(tooltip, link, quantity)
- local item_id, suffix_id = aux.info.parse_link(link)
+ local item_id, suffix_id = info.parse_link(link)
quantity = IsShiftKeyDown() and quantity or 1
if g.aux_tooltip_disenchant_source then
local color = {r=0.7, g=0.7, b=0.7}
- local type, range = aux.disenchant.source(item_id)
+ 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), color.r, color.g, color.b, true)
@@ -63,9 +63,9 @@ function extend_tooltip(tooltip, link, quantity)
end
end
- local item_info = aux.info.item(item_id)
+ local item_info = info.item(item_id)
if item_info then
- local distribution = aux.disenchant.distribution(item_info.slot, item_info.quality, item_info.level)
+ local distribution = disenchant.distribution(item_info.slot, item_info.quality, item_info.level)
if getn(distribution) > 0 then
@@ -75,15 +75,15 @@ function extend_tooltip(tooltip, link, quantity)
tooltip:AddLine('Disenchants into:', color.r, color.g, color.b)
sort(distribution, function(a,b) return a.probability > b.probability end)
for _, event in distribution do
- tooltip:AddLine(format(' %s%% %s (%s-%s)', event.probability * 100, aux.info.display_name(event.item_id, true) or 'item:'..event.item_id, event.min_quantity, event.max_quantity), color.r, color.g, color.b)
+ tooltip:AddLine(format(' %s%% %s (%s-%s)', event.probability * 100, info.display_name(event.item_id, true) or 'item:'..event.item_id, event.min_quantity, event.max_quantity), color.r, color.g, color.b)
end
end
if g.aux_tooltip_disenchant_value then
local color = {r=0.1, g=0.6, b=0.6}
- local disenchant_value = aux.disenchant.value(item_info.slot, item_info.quality, item_info.level)
- tooltip:AddLine('Disenchant Value: '..(disenchant_value and aux.money.to_string2(disenchant_value) or GRAY_FONT_COLOR_CODE..'---'..FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
+ 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.r, color.g, color.b)
end
end
end
@@ -91,33 +91,33 @@ function extend_tooltip(tooltip, link, quantity)
if g.aux_tooltip_vendor_buy then
local color = {r=0.8, g=0.5, b=0.1}
- local _, price, limited = aux.cache.merchant_info(item_id)
+ local _, price, limited = cache.merchant_info(item_id)
if price then
- tooltip:AddLine('Vendor Buy '..(limited and '(limited): ' or ': ')..aux.money.to_string2(price * quantity), color.r, color.g, color.b)
+ tooltip:AddLine('Vendor Buy '..(limited and '(limited): ' or ': ')..money.to_string2(price * quantity), color.r, color.g, color.b)
end
end
if g.aux_tooltip_vendor_sell then
local color = {r=0.8, g=0.5, b=0.1}
- local price = aux.cache.merchant_info(item_id)
+ local price = cache.merchant_info(item_id)
if price ~= 0 then
- tooltip:AddLine('Vendor Sell: '..(price and aux.money.to_string2(price * quantity) or GRAY_FONT_COLOR_CODE..'---'..FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
+ tooltip:AddLine('Vendor Sell: '..(price and money.to_string2(price * quantity) or GRAY_FONT_COLOR_CODE..'---'..FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
end
end
local color = {r=1, g=1, b=0.6}
- local auctionable = not item_info or aux.info.auctionable(aux.info.tooltip(function(tt) tt:SetHyperlink(item_info.itemstring) end), item_info.quality)
+ local auctionable = not item_info or info.auctionable(info.tooltip(function(tt) tt:SetHyperlink(item_info.itemstring) end), item_info.quality)
local item_key = (item_id or 0)..':'..(suffix_id or 0)
- local value = aux.history.value(item_key)
+ local value = history.value(item_key)
if auctionable then
if g.aux_tooltip_value then
- tooltip:AddLine('Value: '..(value and aux.money.to_string2(value * quantity) or GRAY_FONT_COLOR_CODE..'---'..FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
+ tooltip:AddLine('Value: '..(value and money.to_string2(value * quantity) or GRAY_FONT_COLOR_CODE..'---'..FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
end
if g.aux_tooltip_daily then
- local market_value = aux.history.market_value(item_key)
- tooltip:AddLine('Today: '..(market_value and aux.money.to_string2(market_value * quantity)..' ('..aux.auction_listing.percentage_historical(round(market_value / value * 100))..')' or GRAY_FONT_COLOR_CODE..'---'..FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
+ 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.r, color.g, color.b)
end
end
@@ -179,7 +179,7 @@ end
function game_tooltip_hooks:SetInboxItem(index)
local name, _, quantity = GetInboxItem(index)
- local id = name and aux.cache.item_id(name)
+ local id = name and cache.item_id(name)
if id then
local _, itemstring, quality = GetItemInfo(id)
local _, _, _, hex = GetItemQualityColor(tonumber(quality))
@@ -243,7 +243,7 @@ function game_tooltip_hooks:SetAuctionSellItem()
if name then
for slot in inventory do
local link = GetContainerItemLink(unpack(slot))
- if link and ({aux.info.parse_link(link)})[5] == name then
+ if link and ({info.parse_link(link)})[5] == name then
extend_tooltip(GameTooltip, link, quantity)
return
end
diff --git a/core.lua b/core.lua
index fd6de90..0316bb6 100644
--- a/core.lua
+++ b/core.lua
@@ -2,25 +2,6 @@ aux.module 'core'
public.bids_loaded = false
public.current_owner_page = nil
-public.last_owner_page_requested = nil
-
-tabs = {}
-function public.tab(index, name)
- local module_env = getfenv(2)
- local tab = {name=name, env=module_env}
- module_env.public.ACTIVE = function() return tab == active_tab end
- for handler in temp-set{'OPEN', 'CLOSE', 'CLICK_LINK', 'USE_ITEM'} do module_env.mutable[handler] = nil end
- tabs[index] = tab
-end
-do
- local active_tab_index
- function accessor.active_tab() return tabs[active_tab_index] end
- function on_tab_click(index)
- call(active_tab_index and active_tab.env.CLOSE)
- active_tab_index = index
- call(active_tab_index and active_tab.env.OPEN)
- end
-end
function LOAD()
do
@@ -72,6 +53,99 @@ function LOAD()
end
end
+function public.log(...)
+ local msg = '[aux]'
+ for i=1,arg.n do msg = msg..' '..tostring(arg[i]) end
+ DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE..msg)
+end
+
+tabs = {}
+function public.tab(index, name)
+ local module_env = getfenv(2)
+ local tab = {name=name, env=module_env}
+ module_env.public.accessor.ACTIVE = function() return tab == active_tab end
+ for _, handler in temp-{'OPEN', 'CLOSE', 'CLICK_LINK', 'USE_ITEM'} do module_env.mutable[handler] = nil end
+ tabs[index] = tab
+end
+do
+ local active_tab_index
+ function accessor.active_tab() return tabs[active_tab_index] end
+ function on_tab_click(index)
+ call(active_tab_index and active_tab.env.CLOSE)
+ active_tab_index = index
+ call(active_tab_index and active_tab.env.OPEN)
+ end
+end
+
+public.orig = {}
+function public.hook(name, handler, object)
+ local orig
+ if object then
+ m.orig[object] = m.orig[object] or {}
+ orig = m.orig[object]
+ else
+ object = g
+ orig = m.orig
+ end
+ assert(not orig[name], '"'..name..'" is already hooked.')
+ orig[name] = object[name]
+ object[name] = handler
+end
+
+do
+ local locked
+ function public.accessor.bid_in_progress() return locked end
+ function public.place_bid(type, index, amount, on_success)
+ if locked then
+ return
+ end
+ local money = GetMoney()
+ PlaceAuctionBid(type, index, amount)
+ if money >= amount then
+ locked = true
+ control.event_listener('CHAT_MSG_SYSTEM', function(kill)
+ if arg1 == ERR_AUCTION_BID_PLACED then
+ call(on_success)
+ locked = false
+ kill()
+ end
+ end)
+ end
+ end
+end
+
+do
+ local locked
+ function public.accessor.cancel_in_progress() return locked end
+ function public.cancel_auction(index, on_success)
+ if locked then
+ return
+ end
+ locked = true
+ CancelAuction(index)
+ control.event_listener('CHAT_MSG_SYSTEM', function(kill)
+ if arg1 == ERR_AUCTION_REMOVED then
+ call(on_success)
+ locked = false
+ kill()
+ end
+ end)
+ end
+end
+
+function public.is_player(name, current)
+ local realm = GetCVar 'realmName'
+ return not current and index(g.aux_characters, realm, name) or UnitName 'player' == name
+end
+
+function public.neutral_faction()
+ return not UnitFactionGroup 'npc'
+end
+
+function public.min_bid_increment(current_bid)
+ return max(1, floor(current_bid / 100) * 5)
+end
+
function AUCTION_HOUSE_SHOW()
AuctionFrame:Hide()
frame:Show()
@@ -92,8 +166,16 @@ function AUCTION_BIDDER_LIST_UPDATE()
bids_loaded = true
end
-function AUCTION_OWNED_LIST_UPDATE()
- current_owner_page = last_owner_page_requested or 0
+do
+ local last_owner_page_requested
+ function GetOwnerAuctionItems(...)
+ local page = arg[1]
+ last_owner_page_requested = page
+ return orig.GetOwnerAuctionItems(unpack(arg))
+ end
+ function AUCTION_OWNED_LIST_UPDATE()
+ current_owner_page = last_owner_page_requested or 0
+ end
end
function ADDON_LOADED.Blizzard_AuctionUI()
@@ -172,27 +254,6 @@ do
end
end
-public.orig = {}
-function public.hook(name, handler, object)
- local orig
- if object then
- m.orig[object] = m.orig[object] or {}
- orig = m.orig[object]
- else
- object = g
- orig = m.orig
- end
- assert(not orig[name], '"'..name..'" is already hooked.')
- orig[name] = object[name]
- object[name] = handler
-end
-
-function GetOwnerAuctionItems(...)
- local page = arg[1]
- last_owner_page_requested = page
- return orig.GetOwnerAuctionItems(unpack(arg))
-end
-
function AuctionFrameAuctions_OnEvent(...)
if AuctionFrameAuctions:IsVisible() then
return orig.AuctionFrameAuctions_OnEvent(unpack(arg))
@@ -215,58 +276,4 @@ function UseContainerItem(...)
for item_info in present(info.container_item(arg[1], arg[2])) do
return active_tab.env.USE_ITEM(item_info)
end
-end
-
-do
- local locked
- function public.bid_in_progress() return locked end
- function public.place_bid(type, index, amount, on_success)
- if locked then
- return
- end
- local money = GetMoney()
- PlaceAuctionBid(type, index, amount)
- if money >= amount then
- locked = true
- control.event_listener('CHAT_MSG_SYSTEM', function(kill)
- if arg1 == ERR_AUCTION_BID_PLACED then
- call(on_success)
- locked = false
- kill()
- end
- end)
- end
- end
-end
-
-do
- local locked
- function public.cancel_in_progress() return locked end
- function public.cancel_auction(index, on_success)
- if locked then
- return
- end
- locked = true
- CancelAuction(index)
- control.event_listener('CHAT_MSG_SYSTEM', function(kill)
- if arg1 == ERR_AUCTION_REMOVED then
- call(on_success)
- locked = false
- kill()
- end
- end)
- end
-end
-
-function public.is_player(name, current)
- local realm = GetCVar 'realmName'
- return not current and index(g.aux_characters, realm, name) or UnitName 'player' == name
-end
-
-function public.neutral_faction()
- return not UnitFactionGroup 'npc'
-end
-
-function public.min_bid_increment(current_bid)
- return max(1, floor(current_bid / 100) * 5)
end
\ No newline at end of file
diff --git a/gui.lua b/gui.lua
index 5b0d6c7..5a5bd28 100644
--- a/gui.lua
+++ b/gui.lua
@@ -123,8 +123,8 @@ do
aux_background:SetTexture(color.content.background())
aux_background:SetAllPoints(DropDownList1Backdrop)
blizzard_backdrop = DropDownList1Backdrop:GetBackdrop()
- aux.hook('ToggleDropDownMenu', function(...)
- local ret = {aux.orig.ToggleDropDownMenu(unpack(arg))}
+ hook('ToggleDropDownMenu', function(...)
+ local ret = {orig.ToggleDropDownMenu(unpack(arg))}
local dropdown = getglobal(arg[4] or '') or this:GetParent()
if strfind(dropdown:GetName() or '', '^aux_frame%d+$') then
set_aux_dropdown_style(dropdown)
@@ -418,7 +418,7 @@ function public.editbox(parent)
-- editbox:Insert'
' for _=1,getn(stack) do - str = str..aux.gui.color.content.background('----') + str = str..gui.color.content.background('----') end end no_line_break = component[1] == 'operator' and component[2] == 'not' - local filter_color = (filter_builder_state.selected == i and aux.gui.color.orange or aux.gui.color.aux) + local filter_color = (filter_builder_state.selected == i and gui.color.orange or gui.color.aux) local component_text = filter_color(component[2]) if component[1] == 'operator' and component[2] ~= 'not' then component_text = component_text..filter_color(tonumber(component[3]) or '') @@ -208,9 +208,9 @@ function public.formatted_post_filter(components) elseif component[1] == 'filter' then for parameter in present(component[3]) do if component[2] == 'item' then - parameter = aux.info.display_name(aux.cache.item_id(parameter)) or '['..parameter..']' - elseif aux.filter.filters[component[2]].input_type == 'money' then - parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true) + parameter = info.display_name(cache.item_id(parameter)) or '['..parameter..']' + elseif filter.filters[component[2]].input_type == 'money' then + parameter = money.to_string(money.from_string(parameter), nil, true) end component_text = component_text..filter_color(': ')..parameter end @@ -262,13 +262,13 @@ end function add_post_filter() for str in present(filter_input:GetText()) do - for filter in present(aux.filter.filters[str]) do + for filter in present(filter.filters[str]) do if filter.input_type ~= '' then str = str..'/'..filter_parameter_input:GetText() end end - local components, error, suggestions = aux.filter.parse_query_string(str) + local components, error, suggestions = filter.parse_query_string(str) if components and getn(components.blizzard) == 0 and getn(components.post) == 1 then add_component(components.post[1]) @@ -325,9 +325,9 @@ function initialize_filter_dropdown() value = filter, func = function() filter_input:SetText(this.value) - if index(aux.filter.filters[this.value], 'input_type') == '' or this.value == 'not' then + if index(filter.filters[this.value], 'input_type') == '' or this.value == 'not' then add_post_filter() - elseif aux.filter.filters[this.value] then + elseif filter.filters[this.value] then filter_parameter_input:Show() filter_parameter_input:SetFocus() else diff --git a/tabs/search/frames.lua b/tabs/search/frames.lua index 7975768..df23950 100644 --- a/tabs/search/frames.lua +++ b/tabs/search/frames.lua @@ -3,31 +3,31 @@ aux.module 'search_tab' FILTER_SPACING = 28.5 function create_frames() - frame = CreateFrame('Frame', nil, aux.frame) + frame = CreateFrame('Frame', nil, frame) frame:SetAllPoints() frame:SetScript('OnUpdate', on_update) frame:Hide() - frame.filter = aux.gui.panel(frame) - frame.filter:SetAllPoints(aux.frame.content) + frame.filter = gui.panel(frame) + frame.filter:SetAllPoints(frame.content) - frame.results = aux.gui.panel(frame) - frame.results:SetAllPoints(aux.frame.content) + frame.results = gui.panel(frame) + frame.results:SetAllPoints(frame.content) frame.saved = CreateFrame('Frame', nil, frame) - frame.saved:SetAllPoints(aux.frame.content) + frame.saved:SetAllPoints(frame.content) - frame.saved.favorite = aux.gui.panel(frame.saved) + frame.saved.favorite = gui.panel(frame.saved) frame.saved.favorite:SetWidth(378.5) frame.saved.favorite:SetPoint('TOPLEFT', 0, 0) frame.saved.favorite:SetPoint('BOTTOMLEFT', 0, 0) - frame.saved.recent = aux.gui.panel(frame.saved) + frame.saved.recent = gui.panel(frame.saved) frame.saved.recent:SetWidth(378.5) frame.saved.recent:SetPoint('TOPRIGHT', 0, 0) frame.saved.recent:SetPoint('BOTTOMRIGHT', 0, 0) do - local btn = aux.gui.button(frame) + local btn = gui.button(frame) btn:SetPoint('TOPLEFT', 0, 0) btn:SetWidth(42) btn:SetHeight(42) @@ -54,7 +54,7 @@ function create_frames() do local panel = CreateFrame('Frame', nil, frame) panel:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]]} - panel:SetBackdropColor(unpack(aux.gui.color.content.background)) + panel:SetBackdropColor(unpack(gui.color.content.background)) panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0) panel:SetPoint('RIGHT', 0, 0) panel:SetHeight(42) @@ -76,42 +76,42 @@ function create_frames() this:SetText(valid_input) end if blizzard_page_index(this:GetText()) and not real_time_button:GetChecked() then - this:SetBackdropColor(aux.gui.color.state.enabled()) + this:SetBackdropColor(gui.color.state.enabled()) else - this:SetBackdropColor(aux.gui.color.state.disabled()) + this:SetBackdropColor(gui.color.state.disabled()) end end do - local editbox = aux.gui.editbox(settings) + local editbox = gui.editbox(settings) editbox:SetPoint('LEFT', 75, 0) editbox:SetWidth(50) editbox:SetNumeric(true) editbox:SetScript('OnTabPressed', function() last_page_input:SetFocus() end) editbox.enter = execute editbox.change = change - local label = aux.gui.label(editbox, 16) + local label = gui.label(editbox, 16) label:SetPoint('RIGHT', editbox, 'LEFT', -6, 0) label:SetText('Pages') - label:SetTextColor(aux.gui.color.text.enabled()) + label:SetTextColor(gui.color.text.enabled()) first_page_input = editbox end do - local editbox = aux.gui.editbox(settings) + local editbox = gui.editbox(settings) editbox:SetPoint('LEFT', first_page_input, 'RIGHT', 10, 0) editbox:SetWidth(50) editbox:SetNumeric(true) editbox:SetScript('OnTabPressed', function() first_page_input:SetFocus() end) editbox.enter = execute editbox.change = change - local label = aux.gui.label(editbox, aux.gui.config.medium_font_size) + local label = gui.label(editbox, gui.config.medium_font_size) label:SetPoint('RIGHT', editbox, 'LEFT', -3.5, 0) label:SetText('-') - label:SetTextColor(aux.gui.color.text.enabled()) + label:SetTextColor(gui.color.text.enabled()) last_page_input = editbox end end do - local btn = aux.gui.checkbutton(settings) + local btn = gui.checkbutton(settings) btn:SetPoint('LEFT', 230, 0) btn:SetWidth(140) btn:SetHeight(25) @@ -126,7 +126,7 @@ function create_frames() public.real_time_button = btn end do - local btn = aux.gui.checkbutton(settings) + local btn = gui.checkbutton(settings) btn:SetPoint('LEFT', real_time_button, 'RIGHT', 15, 0) btn:SetWidth(140) btn:SetHeight(25) @@ -141,7 +141,7 @@ function create_frames() auto_buy_button = btn end do - local btn = aux.gui.checkbutton(settings) + local btn = gui.checkbutton(settings) btn:SetPoint('LEFT', auto_buy_button, 'RIGHT', 15, 0) btn:SetWidth(140) btn:SetHeight(25) @@ -169,7 +169,7 @@ function create_frames() auto_buy_filter_button = btn end do - local btn = aux.gui.button(controls, 25) + local btn = gui.button(controls, 25) btn:SetPoint('LEFT', 5, 0) btn:SetWidth(30) btn:SetHeight(25) @@ -178,7 +178,7 @@ function create_frames() previous_button = btn end do - local btn = aux.gui.button(controls, 25) + local btn = gui.button(controls, 25) btn:SetPoint('LEFT', previous_button, 'RIGHT', 4, 0) btn:SetWidth(30) btn:SetHeight(25) @@ -187,7 +187,7 @@ function create_frames() next_button = btn end do - local btn = aux.gui.button(controls, aux.gui.config.huge_font_size) + local btn = gui.button(controls, gui.config.huge_font_size) btn:SetPoint('RIGHT', -5, 0) btn:SetWidth(70) btn:SetHeight(25) @@ -202,31 +202,31 @@ function create_frames() start_button = btn end do - local btn = aux.gui.button(controls, aux.gui.config.huge_font_size) + local btn = gui.button(controls, gui.config.huge_font_size) btn:SetPoint('RIGHT', -5, 0) btn:SetWidth(70) btn:SetHeight(25) btn:SetText('Stop') btn:SetScript('OnClick', function() - aux.scan.abort(search_scan_id) + scan.abort(search_scan_id) end) stop_button = btn end do - local btn = aux.gui.button(controls, aux.gui.config.huge_font_size) + local btn = gui.button(controls, gui.config.huge_font_size) btn:SetPoint('RIGHT', start_button, 'LEFT', -4, 0) btn:SetWidth(70) btn:SetHeight(25) - btn:SetText(aux.gui.color.green 'Resume') + btn:SetText(gui.color.green 'Resume') btn:SetScript('OnClick', function() execute(true) end) resume_button = btn end do - local editbox = aux.gui.editbox(controls) + local editbox = gui.editbox(controls) editbox:EnableMouse(1) - editbox.complete = aux.completion.complete_filter + editbox.complete = completion.complete_filter editbox:SetPoint('RIGHT', start_button, 'LEFT', -4, 0) editbox:SetHeight(25) editbox.char = function() @@ -239,11 +239,11 @@ function create_frames() search_box = editbox end do - aux.gui.horizontal_line(frame, -40) + gui.horizontal_line(frame, -40) end do - local btn = aux.gui.button(frame, aux.gui.config.large_font_size2) - btn:SetPoint('BOTTOMLEFT', aux.frame.content, 'TOPLEFT', 10, 8) + local btn = gui.button(frame, gui.config.large_font_size2) + btn:SetPoint('BOTTOMLEFT', frame.content, 'TOPLEFT', 10, 8) btn:SetWidth(243) btn:SetHeight(22) btn:SetText 'Search Results' @@ -251,7 +251,7 @@ function create_frames() search_results_button = btn end do - local btn = aux.gui.button(frame, aux.gui.config.large_font_size2) + local btn = gui.button(frame, gui.config.large_font_size2) btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0) btn:SetWidth(243) btn:SetHeight(22) @@ -260,7 +260,7 @@ function create_frames() saved_searches_button = btn end do - local btn = aux.gui.button(frame, aux.gui.config.large_font_size2) + local btn = gui.button(frame, gui.config.large_font_size2) btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0) btn:SetWidth(243) btn:SetHeight(22) @@ -272,11 +272,11 @@ function create_frames() local frame = CreateFrame('Frame', nil, frame) frame:SetWidth(265) frame:SetHeight(25) - frame:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6) + frame:SetPoint('TOPLEFT', frame.content, 'BOTTOMLEFT', 0, -6) status_bar_frame = frame end do - local btn = aux.gui.button(frame.results, 16) + local btn = gui.button(frame.results, 16) btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) @@ -285,7 +285,7 @@ function create_frames() bid_button = btn end do - local btn = aux.gui.button(frame.results, 16) + local btn = gui.button(frame.results, 16) btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) @@ -294,7 +294,7 @@ function create_frames() buyout_button = btn end do - local btn = aux.gui.button(frame.results, 16) + local btn = gui.button(frame.results, 16) btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) @@ -305,13 +305,13 @@ function create_frames() end) end do - local btn = aux.gui.button(frame.saved, 16) + local btn = gui.button(frame.saved, 16) btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) btn:SetText 'Favorite' btn:SetScript('OnClick', function() - local filters = aux.filter.queries(search_box:GetText()) + local filters = filter.queries(search_box:GetText()) if filters then tinsert(g.aux_favorite_searches, 1, { filter_string = search_box:GetText(), @@ -322,30 +322,30 @@ function create_frames() end) end do - local btn1 = aux.gui.button(frame.filter, 16) + local btn1 = gui.button(frame.filter, 16) btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) - aux.gui.set_size(btn1, 80, 24) + gui.set_size(btn1, 80, 24) btn1:SetText 'Search' btn1:SetScript('OnClick', function() export_query_string() execute() end) - local btn2 = aux.gui.button(frame.filter, 16) + local btn2 = gui.button(frame.filter, 16) btn2:SetPoint('LEFT', btn1, 'RIGHT', 5, 0) - aux.gui.set_size(btn2, 80, 24) + gui.set_size(btn2, 80, 24) btn2:SetText 'Export' btn2:SetScript('OnClick', export_query_string) - local btn3 = aux.gui.button(frame.filter, 16) + local btn3 = gui.button(frame.filter, 16) btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0) - aux.gui.set_size(btn3, 80, 24) + gui.set_size(btn3, 80, 24) btn3:SetText 'Import' btn3:SetScript('OnClick', import_query_string) end do - local editbox = aux.gui.editbox(frame.filter) - editbox.complete_item = aux.completion.complete(function() return g.aux_auctionable_items end) + local editbox = gui.editbox(frame.filter) + editbox.complete_item = completion.complete(function() return g.aux_auctionable_items end) editbox:SetPoint('TOPLEFT', 14, -FILTER_SPACING) editbox:SetWidth(260) editbox.char = function() @@ -365,22 +365,22 @@ function create_frames() end) editbox.change = update_form editbox.enter = L(editbox.ClearFocus, editbox) - local label = aux.gui.label(editbox, aux.gui.config.small_font_size) + local label = gui.label(editbox, gui.config.small_font_size) label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) label:SetText 'Name' name_input = editbox end do - local checkbox = aux.gui.checkbox(frame.filter) + local checkbox = gui.checkbox(frame.filter) checkbox:SetPoint('TOPLEFT', name_input, 'TOPRIGHT', 16, 0) checkbox:SetScript('OnClick', update_form) - local label = aux.gui.label(checkbox, aux.gui.config.small_font_size) + local label = gui.label(checkbox, gui.config.small_font_size) label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1) label:SetText('Exact') exact_checkbox = checkbox end do - local editbox = aux.gui.editbox(frame.filter) + local editbox = gui.editbox(frame.filter) editbox:SetPoint('TOPLEFT', name_input, 'BOTTOMLEFT', 0, -FILTER_SPACING) editbox:SetWidth(125) editbox:SetNumeric(true) @@ -399,13 +399,13 @@ function create_frames() end update_form() end - local label = aux.gui.label(editbox, aux.gui.config.small_font_size) + local label = gui.label(editbox, gui.config.small_font_size) label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) label:SetText 'Level Range' min_level_input = editbox end do - local editbox = aux.gui.editbox(frame.filter) + local editbox = gui.editbox(frame.filter) editbox:SetPoint('TOPLEFT', min_level_input, 'TOPRIGHT', 10, 0) editbox:SetWidth(125) editbox:SetNumeric(true) @@ -424,26 +424,26 @@ function create_frames() end update_form() end - local label = aux.gui.label(editbox, aux.gui.config.medium_font_size) + local label = gui.label(editbox, gui.config.medium_font_size) label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0) label:SetText('-') max_level_input = editbox end do - local checkbox = aux.gui.checkbox(frame.filter) + local checkbox = gui.checkbox(frame.filter) checkbox:SetPoint('TOPLEFT', max_level_input, 'TOPRIGHT', 16, 0) checkbox:SetScript('OnClick', update_form) - local label = aux.gui.label(checkbox, aux.gui.config.small_font_size) + local label = gui.label(checkbox, gui.config.small_font_size) label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1) label:SetText('Usable') usable_checkbox = checkbox end do - local dropdown = aux.gui.dropdown(frame.filter) + local dropdown = gui.dropdown(frame.filter) class_dropdown = dropdown dropdown:SetPoint('TOPLEFT', min_level_input, 'BOTTOMLEFT', 0, 5 - FILTER_SPACING) dropdown:SetWidth(300) - local label = aux.gui.label(dropdown, aux.gui.config.small_font_size) + local label = gui.label(dropdown, gui.config.small_font_size) label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) label:SetText('Item Class') UIDropDownMenu_Initialize(dropdown, initialize_class_dropdown) @@ -452,11 +452,11 @@ function create_frames() end) end do - local dropdown = aux.gui.dropdown(frame.filter) + local dropdown = gui.dropdown(frame.filter) subclass_dropdown = dropdown dropdown:SetPoint('TOPLEFT', class_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) dropdown:SetWidth(300) - local label = aux.gui.label(dropdown, aux.gui.config.small_font_size) + local label = gui.label(dropdown, gui.config.small_font_size) label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) label:SetText('Item Subclass') UIDropDownMenu_Initialize(dropdown, initialize_subclass_dropdown) @@ -465,11 +465,11 @@ function create_frames() end) end do - local dropdown = aux.gui.dropdown(frame.filter) + local dropdown = gui.dropdown(frame.filter) slot_dropdown = dropdown dropdown:SetPoint('TOPLEFT', subclass_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) dropdown:SetWidth(300) - local label = aux.gui.label(dropdown, aux.gui.config.small_font_size) + local label = gui.label(dropdown, gui.config.small_font_size) label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) label:SetText('Item Slot') UIDropDownMenu_Initialize(dropdown, initialize_slot_dropdown) @@ -478,11 +478,11 @@ function create_frames() end) end do - local dropdown = aux.gui.dropdown(frame.filter) + local dropdown = gui.dropdown(frame.filter) quality_dropdown = dropdown dropdown:SetPoint('TOPLEFT', slot_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) dropdown:SetWidth(300) - local label = aux.gui.label(dropdown, aux.gui.config.small_font_size) + local label = gui.label(dropdown, gui.config.small_font_size) label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) label:SetText('Min Quality') UIDropDownMenu_Initialize(dropdown, initialize_quality_dropdown) @@ -490,9 +490,9 @@ function create_frames() UIDropDownMenu_Initialize(this, initialize_quality_dropdown) end) end - aux.gui.vertical_line(frame.filter, 332) + gui.vertical_line(frame.filter, 332) do - local dropdown = aux.gui.dropdown(frame.filter) + local dropdown = gui.dropdown(frame.filter) dropdown:SetPoint('TOPRIGHT', -174.5, -10) dropdown:SetWidth(150) UIDropDownMenu_Initialize(dropdown, initialize_filter_dropdown) @@ -500,24 +500,24 @@ function create_frames() UIDropDownMenu_Initialize(this, initialize_filter_dropdown) end) getglobal(dropdown:GetName()..'Text'):Hide() - local label = aux.gui.label(dropdown, aux.gui.config.medium_font_size) + local label = gui.label(dropdown, gui.config.medium_font_size) label:SetPoint('RIGHT', dropdown, 'LEFT', -15, 0) label:SetText('Post Filter') filter_dropdown = dropdown end do - local input = aux.gui.editbox(frame.filter) + local input = gui.editbox(frame.filter) input:SetPoint('CENTER', filter_dropdown, 'CENTER', 0, 0) input:SetWidth(150) input:SetScript('OnTabPressed', function() filter_parameter_input:SetFocus() end) - input.complete = aux.completion.complete(function() return {'and', 'or', 'not', unpack(keys(aux.filter.filters))} end) + input.complete = completion.complete(function() return {'and', 'or', 'not', unpack(keys(filter.filters))} end) input.char = function() this:complete() end input.change = function() local filter = this:GetText() - if aux.filter.filters[filter] and aux.filter.filters[filter].input_type ~= '' then - local _, _, suggestions = aux.filter.parse_query_string(filter..'/') - filter_parameter_input:SetNumeric(aux.filter.filters[filter].input_type == 'number') - filter_parameter_input.complete = aux.completion.complete(function() return suggestions or {} end) + if filter.filters[filter] and filter.filters[filter].input_type ~= '' then + local _, _, suggestions = filter.parse_query_string(filter..'/') + filter_parameter_input:SetNumeric(filter.filters[filter].input_type == 'number') + filter_parameter_input.complete = completion.complete(function() return suggestions or {} end) filter_parameter_input:Show() else filter_parameter_input:Hide() @@ -533,7 +533,7 @@ function create_frames() filter_input = input end do - local input = aux.gui.editbox(frame.filter) + local input = gui.editbox(frame.filter) input:SetPoint('LEFT', filter_dropdown, 'RIGHT', 10, 0) input:SetWidth(150) input:SetScript('OnTabPressed', function() @@ -575,11 +575,11 @@ function create_frames() scroll_frame:SetScript('OnDragStop', function() this:SetScript('OnUpdate', nil) end) - aux.gui.set_content_style(scroll_frame, -2, -2, -2, -2) + gui.set_content_style(scroll_frame, -2, -2, -2, -2) local scroll_child = CreateFrame('SimpleHTML', nil, scroll_frame) scroll_frame:SetScrollChild(scroll_child) scroll_child:SetFont('p', [[Fonts\ARIALN.TTF]], 23) - scroll_child:SetTextColor('p', aux.gui.color.label.enabled()) + scroll_child:SetTextColor('p', gui.color.label.enabled()) scroll_child:SetWidth(1) scroll_child:SetHeight(1) scroll_child:SetScript('OnHyperlinkClick', data_link_click) @@ -591,12 +591,12 @@ function create_frames() status_bars = {} tables = {} for _=1,5 do - local status_bar = aux.gui.status_bar(frame) + local status_bar = gui.status_bar(frame) status_bar:SetAllPoints(status_bar_frame) status_bar:Hide() tinsert(status_bars, status_bar) - local table = aux.auction_listing.CreateAuctionResultsTable(frame.results, aux.auction_listing.search_config) + local table = auction_listing.CreateAuctionResultsTable(frame.results, auction_listing.search_config) table:SetHandler('OnCellClick', function(cell, button) if IsAltKeyDown() and current_search.table:GetSelection().record == cell.row.data.record then if button == 'LeftButton' and buyout_button:IsEnabled() then @@ -659,7 +659,7 @@ function create_frames() end } - recent_searches_listing = aux.listing.CreateScrollingTable(frame.saved.recent) + recent_searches_listing = listing.CreateScrollingTable(frame.saved.recent) recent_searches_listing:SetColInfo{{name='Recent Searches', width=1}} recent_searches_listing:EnableSorting(false) recent_searches_listing:DisableSelection(true) @@ -667,7 +667,7 @@ function create_frames() recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter) recent_searches_listing:SetHandler('OnLeave', handlers.OnLeave) - favorite_searches_listing = aux.listing.CreateScrollingTable(frame.saved.favorite) + favorite_searches_listing = listing.CreateScrollingTable(frame.saved.favorite) favorite_searches_listing:SetColInfo{{name='Favorite Searches', width=1}} favorite_searches_listing:EnableSorting(false) favorite_searches_listing:DisableSelection(true) diff --git a/tabs/search/results.lua b/tabs/search/results.lua index 4800967..c4d3b55 100644 --- a/tabs/search/results.lua +++ b/tabs/search/results.lua @@ -98,7 +98,7 @@ function update_continuation() end function discard_continuation() - aux.scan.abort(search_scan_id) + scan.abort(search_scan_id) current_search.continuation = nil update_continuation() end @@ -115,7 +115,7 @@ end function update_auto_buy_filter() if g.aux_auto_buy_filter ~= '' then - local queries = aux.filter.queries(g.aux_auto_buy_filter) + local queries = filter.queries(g.aux_auto_buy_filter) if queries then if getn(queries) > 1 then log('Error: The automatic buyout filter may contain only one query') @@ -144,7 +144,7 @@ function start_real_time_scan(query, search, continuation) local next_page local new_records = {} - search_scan_id = aux.scan.start{ + search_scan_id = scan.start{ type = 'list', queries = {query}, auto_buy_validator = search.auto_buy_validator, @@ -162,8 +162,8 @@ function start_real_time_scan(query, search, continuation) if not ignore_page then if search.auto_buy then ctrl.suspend() - aux.place_bid('list', auction_record.index, auction_record.buyout_price, L(ctrl.resume, true)) - aux.control.thread(aux.control.when, later(GetTime(), 10), L(ctrl.resume, false)) + place_bid('list', auction_record.index, auction_record.buyout_price, L(ctrl.resume, true)) + control.thread(control.when, later(GetTime(), 10), L(ctrl.resume, false)) else tinsert(new_records, auction_record) end @@ -228,7 +228,7 @@ function start_search(queries, continuation) end - search_scan_id = aux.scan.start{ + search_scan_id = scan.start{ type = 'list', queries = queries, auto_buy_validator = search.auto_buy_validator, @@ -258,8 +258,8 @@ function start_search(queries, continuation) on_auction = function(auction_record, ctrl) if search.auto_buy then ctrl.suspend() - aux.place_bid('list', auction_record.index, auction_record.buyout_price, L(ctrl.resume, true)) - aux.control.thread(aux.control.when, later(GetTime(), 10), L(ctrl.resume, false)) + place_bid('list', auction_record.index, auction_record.buyout_price, L(ctrl.resume, true)) + control.thread(control.when, later(GetTime(), 10), L(ctrl.resume, false)) elseif getn(search.records) < 1000 then tinsert(search.records, auction_record) if getn(search.records) == 1000 then @@ -310,7 +310,7 @@ function public.execute(resume, real_time) end local filter_string = search_box:GetText() - local queries = aux.filter.queries(filter_string) + local queries = filter.queries(filter_string) if not queries then return elseif real_time then @@ -367,7 +367,7 @@ end function test(record) return function(index) - local auction_info = aux.info.auction(index) + local auction_info = info.auction(index) return auction_info and auction_info.search_signature == record.search_signature end end @@ -381,13 +381,13 @@ do function find_auction(record) local search = current_search - if not search.table:ContainsRecord(record) or aux.is_player(record.owner) then + if not search.table:ContainsRecord(record) or is_player(record.owner) then return end - aux.scan.abort(scan_id) + scan.abort(scan_id) state = SEARCHING - scan_id = aux.scan_util.find( + scan_id = scan_util.find( record, current_search.status_bar, function() @@ -408,8 +408,8 @@ do if not record.high_bidder then bid_button:SetScript('OnClick', function() if test(record)(index) and search.table:ContainsRecord(record) then - aux.place_bid('list', index, record.bid_price, record.bid_price < record.buyout_price and function() - aux.info.bid_update(record) + place_bid('list', index, record.bid_price, record.bid_price < record.buyout_price and function() + info.bid_update(record) search.table:SetDatabase() end or L(search.table.RemoveAuctionRecord, search.table, record)) end @@ -420,7 +420,7 @@ do if record.buyout_price > 0 then buyout_button:SetScript('OnClick', function() if test(record)(index) and search.table:ContainsRecord(record) then - aux.place_bid('list', index, record.buyout_price, L(search.table.RemoveAuctionRecord, search.table, record)) + place_bid('list', index, record.buyout_price, L(search.table.RemoveAuctionRecord, search.table, record)) end end) buyout_button:Enable() @@ -447,7 +447,7 @@ do elseif state == FOUND and not test(selection.record)(found_index) then buyout_button:Disable() bid_button:Disable() - if not aux.bid_in_progress() then + if not bid_in_progress() then state = IDLE end end diff --git a/util/completion.lua b/util/completion.lua index c5dbda8..c63cdb2 100644 --- a/util/completion.lua +++ b/util/completion.lua @@ -8,7 +8,7 @@ function public:complete_filter() local filter_string = this:GetText() local completed_filter_string = ({strfind(filter_string, '([^;]*)/[^/;]*$')})[3] - local _, suggestions = aux.filter.query(completed_filter_string or '') + local _, suggestions = filter.query(completed_filter_string or '') local start_index, _, current_modifier = strfind(filter_string, '([^/;]*)$') current_modifier = current_modifier or '' diff --git a/util/core.lua b/util/core.lua index e665a58..c6f8ddd 100644 --- a/util/core.lua +++ b/util/core.lua @@ -1,6 +1,6 @@ aux.module 'util' -local temp, recycle, getn = temp, recycle, g.getn +local temp, recycle, getn = g.temp, g.recycle, g.getn function public.copy(t) local copy = {} @@ -9,6 +9,12 @@ function public.copy(t) return copy end +public.join = g.table.concat + +function public.replicate(count, value) + if count > 0 then return value, replicate(count - 1, value) end +end + do local value, charges local function setter(n) @@ -18,7 +24,7 @@ do return v end end - for i=1,9 do public[join(replicate(i, 'x'))] = setter(i) end + for i=1,9 do public[join{replicate(i, 'x')}] = setter(i) end function public.accessor.__() assert(charges > 0) charges = charges - 1 @@ -183,10 +189,6 @@ function public.all(xs, p) return true end -function public.replicate(count, value) - return value, replicate(count - 1, value) -end - function public.filter(xs, p) local ys = {} for k, x in xs do @@ -233,8 +235,6 @@ function public.split(str, separator) end end -public.join = g.table.concat - function public.tokenize(str) local tokens = {} for token in string.gfind(str, '%S+') do tinsert(tokens, token) end @@ -265,9 +265,9 @@ function public.bag_type(bag) return 1 end for link in present(GetInventoryItemLink('player', ContainerIDToInventoryID(bag))) do - local item_id = aux.info.parse_link(link) - local item_info = aux.info.item(item_id) - return aux.info.item_subclass_index(3, item_info.subclass) + local item_id = info.parse_link(link) + local item_info = info.item(item_id) + return info.item_subclass_index(3, item_info.subclass) end end diff --git a/util/filter.lua b/util/filter.lua index bb179af..911c88c 100644 --- a/util/filter.lua +++ b/util/filter.lua @@ -19,7 +19,7 @@ public.filters = { input_type = '', validator = function() return function(auction_record) - return auction_record.usable and not aux.info.tooltip_match(ITEM_SPELL_KNOWN, auction_record.tooltip) + return auction_record.usable and not info.tooltip_match(ITEM_SPELL_KNOWN, auction_record.tooltip) end end, }, @@ -35,7 +35,7 @@ public.filters = { input_type = 'string', validator = function(name) return function(auction_record) - return strlower(aux.info.item(auction_record.item_id).name) == name + return strlower(info.item(auction_record.item_id).name) == name end end }, @@ -117,8 +117,8 @@ public.filters = { validator = function(pct) return function(auction_record) return auction_record.unit_buyout_price > 0 - and aux.history.value(auction_record.item_key) - and auction_record.unit_buyout_price / aux.history.value(auction_record.item_key) * 100 <= pct + and history.value(auction_record.item_key) + and auction_record.unit_buyout_price / history.value(auction_record.item_key) * 100 <= pct end end }, @@ -128,8 +128,8 @@ public.filters = { validator = function(pct) return function(auction_record) return auction_record.unit_buyout_price > 0 - and aux.history.value(auction_record.item_key) - and auction_record.unit_buyout_price / aux.history.value(auction_record.item_key) * 100 <= pct + and history.value(auction_record.item_key) + and auction_record.unit_buyout_price / history.value(auction_record.item_key) * 100 <= pct end end }, @@ -138,7 +138,7 @@ public.filters = { input_type = 'money', validator = function(amount) return function(auction_record) - return aux.history.value(auction_record.item_key) and aux.history.value(auction_record.item_key) * auction_record.aux_quantity - auction_record.bid_price >= amount + return history.value(auction_record.item_key) and history.value(auction_record.item_key) * auction_record.aux_quantity - auction_record.bid_price >= amount end end }, @@ -147,7 +147,7 @@ public.filters = { input_type = 'money', validator = function(amount) return function(auction_record) - return auction_record.buyout_price > 0 and aux.history.value(auction_record.item_key) and aux.history.value(auction_record.item_key) * auction_record.aux_quantity - auction_record.buyout_price >= amount + return auction_record.buyout_price > 0 and history.value(auction_record.item_key) and history.value(auction_record.item_key) * auction_record.aux_quantity - auction_record.buyout_price >= amount end end }, @@ -156,7 +156,7 @@ public.filters = { input_type = 'money', validator = function(amount) return function(auction_record) - local disenchant_value = aux.disenchant.value(auction_record.slot, auction_record.quality, auction_record.level) + local disenchant_value = disenchant.value(auction_record.slot, auction_record.quality, auction_record.level) return disenchant_value and disenchant_value - auction_record.bid_price >= amount end end @@ -166,7 +166,7 @@ public.filters = { input_type = 'money', validator = function(amount) return function(auction_record) - local disenchant_value = aux.disenchant.value(auction_record.slot, auction_record.quality, auction_record.level) + local disenchant_value = disenchant.value(auction_record.slot, auction_record.quality, auction_record.level) return auction_record.buyout_price > 0 and disenchant_value and disenchant_value - auction_record.buyout_price >= amount end end @@ -176,7 +176,7 @@ public.filters = { input_type = 'money', validator = function(amount) return function(auction_record) - local vendor_price = aux.cache.merchant_info(auction_record.item_id) + local vendor_price = cache.merchant_info(auction_record.item_id) return vendor_price and vendor_price * auction_record.aux_quantity - auction_record.bid_price >= amount end end @@ -186,7 +186,7 @@ public.filters = { input_type = 'money', validator = function(amount) return function(auction_record) - local vendor_price = aux.cache.merchant_info(auction_record.item_id) + local vendor_price = cache.merchant_info(auction_record.item_id) return auction_record.buyout_price > 0 and vendor_price and vendor_price * auction_record.aux_quantity - auction_record.buyout_price >= amount end end @@ -234,10 +234,10 @@ do end end for _, parser in { - {'class', aux.info.item_class_index}, - {'subclass', L(aux.info.item_subclass_index, index(self.class, 2) or 0, _1)}, - {'slot', L(aux.info.item_slot_index, index(self.class, 2) or 0, index(self.subclass, 2) or 0, _1)}, - {'quality', aux.info.item_quality_index}, + {'class', info.item_class_index}, + {'subclass', L(info.item_subclass_index, index(self.class, 2) or 0, _1)}, + {'slot', L(info.item_slot_index, index(self.class, 2) or 0, index(self.subclass, 2) or 0, _1)}, + {'quality', info.item_quality_index}, } do if not self[parser[1]] then tinsert(parser, str) @@ -266,7 +266,7 @@ end function parse_parameter(input_type, str) if input_type == 'money' then - local money = aux.money.from_string(str) + local money = money.from_string(str) return money and money > 0 and money or nil elseif input_type == 'number' then local number = tonumber(str) @@ -444,8 +444,8 @@ function public.query_string(components) elseif component[1] == 'filter' then query_builder.append(component[2]) for _, parameter in {component[3]} do - if aux.filter.filters[component[2]].input_type == 'money' then - parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, nil, true) + if filter.filters[component[2]].input_type == 'money' then + parameter = money.to_string(money.from_string(parameter), nil, true, nil, nil, true) end query_builder.append(parameter) end @@ -460,38 +460,38 @@ function prettified_query_string(components) for key, filter in components.blizzard do if key == 'exact' then - prettified.prepend(aux.info.display_name(aux.cache.item_id(components.blizzard.name[2])) or aux.gui.color.blizzard('['..components.blizzard.name[2]..']')) + prettified.prepend(info.display_name(cache.item_id(components.blizzard.name[2])) or gui.color.blizzard('['..components.blizzard.name[2]..']')) elseif key ~= 'name' then - prettified.append(aux.gui.color.blizzard(filter[1])) + prettified.append(gui.color.blizzard(filter[1])) end end if components.blizzard.name and not components.blizzard.exact and components.blizzard.name[2] ~= '' then - prettified.prepend(aux.gui.color.blizzard(components.blizzard.name[2])) + prettified.prepend(gui.color.blizzard(components.blizzard.name[2])) end for _, component in components.post do if component[1] == 'operator' then - prettified.append(aux.gui.color.aux(component[2]..(component[2] ~= 'not' and tonumber(component[3]) or ''))) + prettified.append(gui.color.aux(component[2]..(component[2] ~= 'not' and tonumber(component[3]) or ''))) elseif component[1] == 'filter' then if component[2] ~= 'tooltip' then - prettified.append(aux.gui.color.aux(component[2])) + prettified.append(gui.color.aux(component[2])) end for parameter in present(component[3]) do if component[2] == 'item' then - prettified.append(aux.info.display_name(aux.cache.item_id(parameter)) or aux.gui.color.label.enabled('['..parameter..']')) + prettified.append(info.display_name(cache.item_id(parameter)) or gui.color.label.enabled('['..parameter..']')) else if filters[component[2]].input_type == 'money' then - prettified.append(aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, aux.gui.inline_color.label.enabled)) + prettified.append(money.to_string(money.from_string(parameter), nil, true, nil, gui.inline_color.label.enabled)) else - prettified.append(aux.gui.color.label.enabled(parameter)) + prettified.append(gui.color.label.enabled(parameter)) end end end end end if prettified.get() == '' then - return aux.gui.color.blizzard'<>' + return gui.color.blizzard'<>' else return prettified.get() end @@ -511,11 +511,11 @@ function 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 x(aux.cache.item_id(filters.name[2])) and x(aux.info.item(__)) then + if filters.exact and x(cache.item_id(filters.name[2])) and x(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) + class_index = info.item_class_index(item_info.class) + subclass_index = info.item_subclass_index(class_index or 0, item_info.subclass) + slot_index = info.item_slot_index(class_index or 0, subclass_index or 0, item_info.slot) end if item_info then @@ -544,7 +544,7 @@ function validator(components) end return function(record) - if components.blizzard.exact and strlower(aux.info.item(record.item_id).name) ~= components.blizzard.name[2] then + if components.blizzard.exact and strlower(info.item(record.item_id).name) ~= components.blizzard.name[2] then return false end local stack = {} diff --git a/util/info.lua b/util/info.lua index 6aad9fd..a6f994e 100644 --- a/util/info.lua +++ b/util/info.lua @@ -121,8 +121,8 @@ function public.auction(index, query_type) link = link, itemstring = item_info.itemstring, item_key = item_id..':'..suffix_id, - search_signature = join({item_id, suffix_id, enchant_id, start_price, buyout_price, bid_price, aux_quantity, duration, query_type == 'owner' and high_bidder or (high_bidder and 1 or 0), g.aux_ignore_owner and (aux.is_player(owner) and 0 or 1) or (owner or '?')}, ':'), - sniping_signature = join({item_id, suffix_id, enchant_id, start_price, buyout_price, aux_quantity, g.aux_ignore_owner and (aux.is_player(owner, true) and 0 or 1) or (owner or '?')}, ':'), + search_signature = join({item_id, suffix_id, enchant_id, start_price, buyout_price, bid_price, aux_quantity, duration, query_type == 'owner' and high_bidder or (high_bidder and 1 or 0), g.aux_ignore_owner and (is_player(owner) and 0 or 1) or (owner or '?')}, ':'), + sniping_signature = join({item_id, suffix_id, enchant_id, start_price, buyout_price, aux_quantity, g.aux_ignore_owner and (is_player(owner, true) and 0 or 1) or (owner or '?')}, ':'), name = name, texture = texture, @@ -161,12 +161,12 @@ end function public.bid_update(auction_record) auction_record.high_bid = auction_record.bid_price auction_record.blizzard_bid = auction_record.bid_price - auction_record.min_increment = aux.min_bid_increment(auction_record.bid_price) + auction_record.min_increment = min_bid_increment(auction_record.bid_price) auction_record.bid_price = auction_record.bid_price + auction_record.min_increment auction_record.unit_blizzard_bid = auction_record.blizzard_bid / auction_record.aux_quantity auction_record.unit_bid_price = auction_record.bid_price / auction_record.aux_quantity auction_record.high_bidder = 1 - auction_record.search_signature = table.concat({auction_record.item_id, auction_record.suffix_id, auction_record.enchant_id, auction_record.start_price, auction_record.buyout_price, auction_record.bid_price, auction_record.aux_quantity, auction_record.duration, 1, g.aux_ignore_owner and (aux.is_player(auction_record.owner) and 0 or 1) or (auction_record.owner or '?')}, ':') + auction_record.search_signature = table.concat({auction_record.item_id, auction_record.suffix_id, auction_record.enchant_id, auction_record.start_price, auction_record.buyout_price, auction_record.bid_price, auction_record.aux_quantity, auction_record.duration, 1, g.aux_ignore_owner and (is_player(auction_record.owner) and 0 or 1) or (auction_record.owner or '?')}, ':') end function public.set_tooltip(itemstring, owner, anchor) @@ -244,7 +244,7 @@ function public.load_tooltip(frame, tooltip) end function public.display_name(item_id, no_brackets, no_color) - for item_info in present(aux.info.item(item_id)) do + for item_info in present(info.item(item_id)) do local name = item_info.name if not no_brackets then name = '['..name..']' @@ -368,7 +368,7 @@ function public.item(item_id, suffix_id) texture = texture, } end - return aux.cache.item_info(item_id) + return cache.item_info(item_id) end function public.item_class_index(item_class) diff --git a/util/persistence.lua b/util/persistence.lua index fe8560e..f788435 100644 --- a/util/persistence.lua +++ b/util/persistence.lua @@ -6,7 +6,7 @@ do local realm, faction function LOAD() - aux.control.thread(aux.control.when, function() faction = UnitFactionGroup 'player' return faction end, function() end) + control.thread(control.when, function() faction = UnitFactionGroup 'player' return faction end, function() end) realm = GetCVar 'realmName' end diff --git a/util/scan_util.lua b/util/scan_util.lua index 2736b5d..e5218f1 100644 --- a/util/scan_util.lua +++ b/util/scan_util.lua @@ -3,7 +3,7 @@ aux.module 'scan_util' function public.find(auction_record, status_bar, on_abort, on_failure, on_success) local function test(index) - local auction_info = aux.info.auction(index, auction_record.query_type) + local auction_info = info.auction(index, auction_record.query_type) return auction_info and auction_info.search_signature == auction_record.search_signature end @@ -36,7 +36,7 @@ function public.find(auction_record, status_bar, on_abort, on_failure, on_succes local found - return aux.scan.start{ + return scan.start{ type = auction_record.query_type, queries = queries, on_scan_start = function() @@ -72,10 +72,10 @@ end function public.item_query(item_id, first_page, last_page) - local item_info = aux.info.item(item_id) + local item_info = info.item(item_id) if item_info then - local query = aux.filter.query(item_info.name..'/exact') + local query = filter.query(item_info.name..'/exact') query.blizzard_query.first_page = first_page query.blizzard_query.last_page = last_page return {