minor bugfix for deposit, saved searches and some other settings are now account wide, the search tab now has a separate status bar for every history entry and switching no longer aborts
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
## Interface: 11200
|
## Interface: 11200
|
||||||
## Title: Aux
|
## Title: Aux
|
||||||
## SavedVariablesPerCharacter: aux_ignore_owner, aux_recent_searches, aux_favorite_searches, aux_auto_buy_filter, aux_price_per_unit, aux_tooltip_value, aux_tooltip_daily, aux_tooltip_vendor_buy, aux_tooltip_vendor_sell, aux_tooltip_disenchant_value, aux_tooltip_disenchant_distribution, aux_tooltip_disenchant_source
|
## SavedVariablesPerCharacter: aux_auto_buy_filter, aux_tooltip_value, aux_tooltip_daily, aux_tooltip_vendor_buy, aux_tooltip_vendor_sell, aux_tooltip_disenchant_value, aux_tooltip_disenchant_distribution, aux_tooltip_disenchant_source
|
||||||
## SavedVariables: aux_datasets, aux_items, aux_item_ids, aux_auctionable_items, aux_merchant_buy, aux_merchant_sell, aux_characters
|
## SavedVariables: aux_datasets, aux_items, aux_item_ids, aux_auctionable_items, aux_merchant_buy, aux_merchant_sell, aux_characters, aux_recent_searches, aux_favorite_searches, aux_ignore_owner, aux_price_per_unit
|
||||||
|
|
||||||
module.lua
|
module.lua
|
||||||
core.xml
|
core.xml
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ function public.LOAD()
|
|||||||
Aux.control.event_listener('NEW_AUCTION_UPDATE', function()
|
Aux.control.event_listener('NEW_AUCTION_UPDATE', function()
|
||||||
local info = Aux.info.auction_sell_item()
|
local info = Aux.info.auction_sell_item()
|
||||||
if info then
|
if info then
|
||||||
if Aux.cache.item_id(info.name) then
|
local item_id = Aux.cache.item_id(info.name)
|
||||||
aux_merchant_sell[Aux.cache.item_id(info.name)] = info.vendor_price / info.aux_quantity
|
if item_id then
|
||||||
|
aux_merchant_sell[Aux.cache.item_id(info.name)] = info.vendor_price / (Aux.info.max_item_charges(item_id) or info.count)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end):start()
|
end):start()
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function public.on_load()
|
function public.on_load()
|
||||||
public.version = '3.4.1'
|
public.version = '3.4.2'
|
||||||
public.blizzard_ui_shown = false
|
public.blizzard_ui_shown = false
|
||||||
public.bids_loaded = false
|
public.bids_loaded = false
|
||||||
public.current_owner_page = nil
|
public.current_owner_page = nil
|
||||||
|
|||||||
@@ -122,9 +122,9 @@ do
|
|||||||
m.find_auction(selection.record)
|
m.find_auction(selection.record)
|
||||||
elseif state == FOUND and not m.test(selection.record)(found_index) then
|
elseif state == FOUND and not m.test(selection.record)(found_index) then
|
||||||
m.cancel_button:Disable()
|
m.cancel_button:Disable()
|
||||||
-- if not Aux.bid_in_progress() then
|
if not Aux.cancel_in_progress() then
|
||||||
state = IDLE
|
state = IDLE
|
||||||
-- end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
+1
-1
@@ -366,7 +366,7 @@ function private.unit_vendor_price(item_key)
|
|||||||
ClearCursor()
|
ClearCursor()
|
||||||
|
|
||||||
if auction_sell_item then
|
if auction_sell_item then
|
||||||
return auction_sell_item.unit_vendor_price
|
return auction_sell_item.vendor_price / auction_sell_item.count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+60
-52
@@ -68,7 +68,7 @@ end
|
|||||||
|
|
||||||
function public.LOAD()
|
function public.LOAD()
|
||||||
m.create_frames(m, public, private)
|
m.create_frames(m, public, private)
|
||||||
m.update_search()
|
m.new_search('')
|
||||||
m.update_tab(m.SAVED)
|
m.update_tab(m.SAVED)
|
||||||
m.update_auto_buy_filter()
|
m.update_auto_buy_filter()
|
||||||
end
|
end
|
||||||
@@ -271,8 +271,8 @@ function private.start_real_time_scan(query, search, continuation)
|
|||||||
queries = {query},
|
queries = {query},
|
||||||
auto_buy_validator = search.auto_buy_validator,
|
auto_buy_validator = search.auto_buy_validator,
|
||||||
on_scan_start = function()
|
on_scan_start = function()
|
||||||
m.status_bar:update_status(99.99, 99.99)
|
search.status_bar:update_status(99.99, 99.99)
|
||||||
m.status_bar:set_text('Scanning last page ...')
|
search.status_bar:set_text('Scanning last page ...')
|
||||||
end,
|
end,
|
||||||
on_page_loaded = function(_, _, last_page)
|
on_page_loaded = function(_, _, last_page)
|
||||||
next_page = last_page
|
next_page = last_page
|
||||||
@@ -315,8 +315,8 @@ function private.start_real_time_scan(query, search, continuation)
|
|||||||
m.start_real_time_scan(query, search)
|
m.start_real_time_scan(query, search)
|
||||||
end,
|
end,
|
||||||
on_abort = function()
|
on_abort = function()
|
||||||
m.status_bar:update_status(100, 100)
|
search.status_bar:update_status(100, 100)
|
||||||
m.status_bar:set_text('Scan paused')
|
search.status_bar:set_text('Scan paused')
|
||||||
|
|
||||||
search.continuation = next_page or not ignore_page and query.blizzard_query.first_page or true
|
search.continuation = next_page or not ignore_page and query.blizzard_query.first_page or true
|
||||||
|
|
||||||
@@ -351,11 +351,11 @@ function private.start_search(queries, continuation)
|
|||||||
queries = queries,
|
queries = queries,
|
||||||
auto_buy_validator = search.auto_buy_validator,
|
auto_buy_validator = search.auto_buy_validator,
|
||||||
on_scan_start = function()
|
on_scan_start = function()
|
||||||
m.status_bar:update_status(0,0)
|
search.status_bar:update_status(0,0)
|
||||||
if continuation then
|
if continuation then
|
||||||
m.status_bar:set_text('Resuming scan...')
|
search.status_bar:set_text('Resuming scan...')
|
||||||
else
|
else
|
||||||
m.status_bar:set_text('Scanning auctions...')
|
search.status_bar:set_text('Scanning auctions...')
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_page_loaded = function(_, total_scan_pages)
|
on_page_loaded = function(_, total_scan_pages)
|
||||||
@@ -363,8 +363,8 @@ function private.start_search(queries, continuation)
|
|||||||
total_scan_pages = total_scan_pages + (start_page - 1)
|
total_scan_pages = total_scan_pages + (start_page - 1)
|
||||||
total_scan_pages = max(total_scan_pages, 1)
|
total_scan_pages = max(total_scan_pages, 1)
|
||||||
current_page = min(current_page, total_scan_pages)
|
current_page = min(current_page, total_scan_pages)
|
||||||
m.status_bar:update_status(100 * (current_query - 1) / getn(queries), 100 * (current_page - 1) / total_scan_pages)
|
search.status_bar:update_status(100 * (current_query - 1) / getn(queries), 100 * (current_page - 1) / total_scan_pages)
|
||||||
m.status_bar:set_text(format('Scanning %d / %d (Page %d / %d)', current_query, total_queries, current_page, total_scan_pages))
|
search.status_bar:set_text(format('Scanning %d / %d (Page %d / %d)', current_query, total_queries, current_page, total_scan_pages))
|
||||||
end,
|
end,
|
||||||
on_page_scanned = function()
|
on_page_scanned = function()
|
||||||
m.results_listing:SetDatabase()
|
m.results_listing:SetDatabase()
|
||||||
@@ -385,8 +385,8 @@ function private.start_search(queries, continuation)
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
m.status_bar:update_status(100, 100)
|
search.status_bar:update_status(100, 100)
|
||||||
m.status_bar:set_text('Scan complete')
|
search.status_bar:set_text('Scan complete')
|
||||||
|
|
||||||
if m.current_search() == search and m.frame.results:IsVisible() and getn(search.records) == 0 then
|
if m.current_search() == search and m.frame.results:IsVisible() and getn(search.records) == 0 then
|
||||||
m.update_tab(m.SAVED)
|
m.update_tab(m.SAVED)
|
||||||
@@ -395,8 +395,8 @@ function private.start_search(queries, continuation)
|
|||||||
m.enable_start()
|
m.enable_start()
|
||||||
end,
|
end,
|
||||||
on_abort = function()
|
on_abort = function()
|
||||||
m.status_bar:update_status(100, 100)
|
search.status_bar:update_status(100, 100)
|
||||||
m.status_bar:set_text('Scan paused')
|
search.status_bar:set_text('Scan paused')
|
||||||
|
|
||||||
if current_query then
|
if current_query then
|
||||||
search.continuation = {current_query, current_page + 1}
|
search.continuation = {current_query, current_page + 1}
|
||||||
@@ -443,24 +443,25 @@ function public.execute(resume, real_time)
|
|||||||
|
|
||||||
if resume then
|
if resume then
|
||||||
m.results_listing:SetSelectedRecord()
|
m.results_listing:SetSelectedRecord()
|
||||||
elseif filter_string ~= m.current_search().filter_string then
|
|
||||||
m.new_search(filter_string, Aux.util.join(Aux.util.map(queries, function(filter) return filter.prettified end), ';'))
|
|
||||||
else
|
else
|
||||||
if m.current_search().real_time ~= real_time then
|
if filter_string ~= m.current_search().filter_string then
|
||||||
m.results_listing:Reset()
|
m.new_search(filter_string, Aux.util.join(Aux.util.map(queries, function(filter) return filter.prettified end), ';'))
|
||||||
|
else
|
||||||
|
m.current_search().records = {}
|
||||||
|
m.results_listing:SetDatabase(m.current_search().records)
|
||||||
|
if m.current_search().real_time ~= real_time then
|
||||||
|
m.results_listing:Reset()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
m.current_search().records = {}
|
|
||||||
m.current_search().real_time = m.real_time_button:GetChecked()
|
m.current_search().real_time = m.real_time_button:GetChecked()
|
||||||
m.current_search().auto_buy = m.auto_buy_button:GetChecked()
|
m.current_search().auto_buy = m.auto_buy_button:GetChecked()
|
||||||
m.current_search().auto_buy_validator = m.auto_buy_filter_button:GetChecked() and m.auto_buy_validator -- some redundancy but why not to be save
|
m.current_search().auto_buy_validator = m.auto_buy_filter_button:GetChecked() and m.auto_buy_validator -- some redundancy to be save
|
||||||
m.results_listing:SetDatabase(m.current_search().records)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local continuation = resume and m.current_search().continuation
|
local continuation = resume and m.current_search().continuation
|
||||||
m.discard_continuation()
|
m.discard_continuation()
|
||||||
m:enable_stop()
|
m:enable_stop()
|
||||||
|
|
||||||
m.close_settings()
|
|
||||||
m.update_tab(m.RESULTS)
|
m.update_tab(m.RESULTS)
|
||||||
if real_time then
|
if real_time then
|
||||||
m.start_real_time_scan(queries[1], nil, continuation)
|
m.start_real_time_scan(queries[1], nil, continuation)
|
||||||
@@ -517,7 +518,7 @@ do
|
|||||||
state = SEARCHING
|
state = SEARCHING
|
||||||
scan_id = Aux.scan_util.find(
|
scan_id = Aux.scan_util.find(
|
||||||
record,
|
record,
|
||||||
m.status_bar,
|
m.current_search().status_bar,
|
||||||
function()
|
function()
|
||||||
state = IDLE
|
state = IDLE
|
||||||
end,
|
end,
|
||||||
@@ -588,28 +589,37 @@ function private.update_continuation()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function private.new_status_bar()
|
||||||
|
local status_bar = Aux.gui.status_bar(m.frame)
|
||||||
|
status_bar:SetAllPoints(m.status_bar_frame)
|
||||||
|
status_bar:update_status(100, 100)
|
||||||
|
status_bar:set_text('')
|
||||||
|
return status_bar
|
||||||
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local searches = { [1] = {
|
local searches = {}
|
||||||
filter_string = '',
|
|
||||||
records = {},
|
|
||||||
}}
|
|
||||||
local search_index = 1
|
local search_index = 1
|
||||||
|
|
||||||
function private.current_search()
|
function private.current_search()
|
||||||
return searches[search_index]
|
return searches[search_index]
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.update_search()
|
function private.update_search(index)
|
||||||
Aux.scan.abort(m.search_scan_id)
|
searches[search_index].status_bar:Hide()
|
||||||
|
|
||||||
|
search_index = index
|
||||||
|
|
||||||
|
searches[search_index].status_bar:Show()
|
||||||
m.search_box:SetText(searches[search_index].filter_string)
|
m.search_box:SetText(searches[search_index].filter_string)
|
||||||
m.results_listing:Reset()
|
m.results_listing:Reset()
|
||||||
m.results_listing:SetDatabase(searches[search_index].records)
|
m.results_listing:SetDatabase(searches[search_index].records)
|
||||||
if search_index == 1 or search_index == 0 then
|
if search_index == 1 then
|
||||||
m.previous_button:Disable()
|
m.previous_button:Disable()
|
||||||
else
|
else
|
||||||
m.previous_button:Enable()
|
m.previous_button:Enable()
|
||||||
end
|
end
|
||||||
if search_index == getn(searches) or search_index == 0 then
|
if search_index == getn(searches) then
|
||||||
m.next_button:Hide()
|
m.next_button:Hide()
|
||||||
m.search_box:SetPoint('LEFT', m.previous_button, 'RIGHT', 4, 0)
|
m.search_box:SetPoint('LEFT', m.previous_button, 'RIGHT', 4, 0)
|
||||||
else
|
else
|
||||||
@@ -620,45 +630,43 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function private.new_search(filter_string, prettified)
|
function private.new_search(filter_string, prettified)
|
||||||
tinsert(aux_recent_searches, 1, {
|
if prettified then
|
||||||
filter_string = filter_string,
|
tinsert(aux_recent_searches, 1, {
|
||||||
prettified = prettified,
|
filter_string = filter_string,
|
||||||
})
|
prettified = prettified,
|
||||||
while getn(aux_recent_searches) > 50 do
|
})
|
||||||
tremove(aux_recent_searches)
|
while getn(aux_recent_searches) > 50 do
|
||||||
|
tremove(aux_recent_searches)
|
||||||
|
end
|
||||||
|
m.update_search_listings()
|
||||||
end
|
end
|
||||||
m.update_search_listings()
|
|
||||||
|
|
||||||
tinsert(searches, search_index + 1, {
|
while getn(searches) > search_index do
|
||||||
filter_string = filter_string,
|
|
||||||
records = {},
|
|
||||||
real_time = m.real_time_button:GetChecked(),
|
|
||||||
auto_buy = m.auto_buy_button:GetChecked(),
|
|
||||||
auto_buy_validator = m.auto_buy_filter_button:GetChecked() and m.auto_buy_validator, -- some redundancy but why not to be save
|
|
||||||
})
|
|
||||||
while getn(searches) > search_index + 1 do
|
|
||||||
tremove(searches)
|
tremove(searches)
|
||||||
end
|
end
|
||||||
|
tinsert(searches, {
|
||||||
|
filter_string = filter_string,
|
||||||
|
records = {},
|
||||||
|
status_bar = m.new_status_bar(),
|
||||||
|
})
|
||||||
if getn(searches) > 5 then
|
if getn(searches) > 5 then
|
||||||
tremove(searches, 1)
|
tremove(searches, 1)
|
||||||
end
|
end
|
||||||
search_index = getn(searches)
|
|
||||||
m.update_search()
|
m.update_search(getn(searches))
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.previous_search()
|
function private.previous_search()
|
||||||
m.search_box:HighlightText(0, 0)
|
m.search_box:HighlightText(0, 0)
|
||||||
m.search_box:ClearFocus()
|
m.search_box:ClearFocus()
|
||||||
search_index = search_index - 1
|
m.update_search(search_index - 1)
|
||||||
m.update_search()
|
|
||||||
m.update_tab(m.RESULTS)
|
m.update_tab(m.RESULTS)
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.next_search()
|
function private.next_search()
|
||||||
m.search_box:HighlightText(0, 0)
|
m.search_box:HighlightText(0, 0)
|
||||||
m.search_box:ClearFocus()
|
m.search_box:ClearFocus()
|
||||||
search_index = search_index + 1
|
m.update_search(search_index + 1)
|
||||||
m.update_search()
|
|
||||||
m.update_tab(m.RESULTS)
|
m.update_tab(m.RESULTS)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+8
-10
@@ -285,17 +285,15 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
private.new_filter_button = btn
|
private.new_filter_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local status_bar = Aux.gui.status_bar(m.frame)
|
local frame = CreateFrame('Frame')
|
||||||
status_bar:SetWidth(265)
|
frame:SetWidth(265)
|
||||||
status_bar:SetHeight(25)
|
frame:SetHeight(25)
|
||||||
status_bar:SetPoint('TOPLEFT', AuxFrameContent, 'BOTTOMLEFT', 0, -6)
|
frame:SetPoint('TOPLEFT', AuxFrameContent, 'BOTTOMLEFT', 0, -6)
|
||||||
status_bar:update_status(100, 100)
|
private.status_bar_frame = frame
|
||||||
status_bar:set_text('')
|
|
||||||
private.status_bar = status_bar
|
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = Aux.gui.button(m.frame.results, 16)
|
local btn = Aux.gui.button(m.frame.results, 16)
|
||||||
btn:SetPoint('TOPLEFT', m.status_bar, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', m.status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
btn:SetText('Bid')
|
btn:SetText('Bid')
|
||||||
@@ -324,7 +322,7 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = Aux.gui.button(m.frame.saved, 16)
|
local btn = Aux.gui.button(m.frame.saved, 16)
|
||||||
btn:SetPoint('TOPLEFT', m.status_bar, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', m.status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
btn:SetText('Favorite')
|
btn:SetText('Favorite')
|
||||||
@@ -341,7 +339,7 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn1 = Aux.gui.button(m.frame.filter, 16)
|
local btn1 = Aux.gui.button(m.frame.filter, 16)
|
||||||
btn1:SetPoint('TOPLEFT', m.status_bar, 'TOPRIGHT', 5, 0)
|
btn1:SetPoint('TOPLEFT', m.status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn1:SetWidth(80)
|
btn1:SetWidth(80)
|
||||||
btn1:SetHeight(24)
|
btn1:SetHeight(24)
|
||||||
btn1:SetText('Search')
|
btn1:SetText('Search')
|
||||||
|
|||||||
+3
-13
@@ -84,23 +84,13 @@ function public.auction_sell_item()
|
|||||||
local name, texture, count, quality, usable, vendor_price = GetAuctionSellItemInfo()
|
local name, texture, count, quality, usable, vendor_price = GetAuctionSellItemInfo()
|
||||||
|
|
||||||
if name then
|
if name then
|
||||||
|
|
||||||
local unit_vendor_price = vendor_price / count
|
|
||||||
local tooltip = m.tooltip(function(tt) tt:SetAuctionSellItem() end)
|
|
||||||
local charges = m.item_charges(tooltip)
|
|
||||||
local aux_quantity = charges > 1 and charges or count
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name = name,
|
name = name,
|
||||||
texture = texture,
|
texture = texture,
|
||||||
quality = quality,
|
quality = quality,
|
||||||
stack_size = count,
|
count = count,
|
||||||
usable = usable,
|
usable = usable,
|
||||||
vendor_price = vendor_price,
|
vendor_price = vendor_price, -- it seems for charge items this is always the price for full charges
|
||||||
unit_vendor_price = unit_vendor_price,
|
|
||||||
|
|
||||||
tooltip = tooltip,
|
|
||||||
aux_quantity = aux_quantity,
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -328,7 +318,7 @@ function private.item_charges(tooltip)
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.max_item_charges(item_id)
|
function public.max_item_charges(item_id)
|
||||||
return ({
|
return ({
|
||||||
-- wizard oil
|
-- wizard oil
|
||||||
[20744] = 5,
|
[20744] = 5,
|
||||||
|
|||||||
Reference in New Issue
Block a user