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
|
||||
## 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
|
||||
## SavedVariables: aux_datasets, aux_items, aux_item_ids, aux_auctionable_items, aux_merchant_buy, aux_merchant_sell, aux_characters
|
||||
## 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, aux_recent_searches, aux_favorite_searches, aux_ignore_owner, aux_price_per_unit
|
||||
|
||||
module.lua
|
||||
core.xml
|
||||
|
||||
@@ -24,8 +24,9 @@ function public.LOAD()
|
||||
Aux.control.event_listener('NEW_AUCTION_UPDATE', function()
|
||||
local info = Aux.info.auction_sell_item()
|
||||
if info then
|
||||
if Aux.cache.item_id(info.name) then
|
||||
aux_merchant_sell[Aux.cache.item_id(info.name)] = info.vendor_price / info.aux_quantity
|
||||
local item_id = Aux.cache.item_id(info.name)
|
||||
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):start()
|
||||
|
||||
@@ -39,7 +39,7 @@ do
|
||||
end
|
||||
|
||||
function public.on_load()
|
||||
public.version = '3.4.1'
|
||||
public.version = '3.4.2'
|
||||
public.blizzard_ui_shown = false
|
||||
public.bids_loaded = false
|
||||
public.current_owner_page = nil
|
||||
|
||||
@@ -122,9 +122,9 @@ do
|
||||
m.find_auction(selection.record)
|
||||
elseif state == FOUND and not m.test(selection.record)(found_index) then
|
||||
m.cancel_button:Disable()
|
||||
-- if not Aux.bid_in_progress() then
|
||||
if not Aux.cancel_in_progress() then
|
||||
state = IDLE
|
||||
-- end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
+1
-1
@@ -366,7 +366,7 @@ function private.unit_vendor_price(item_key)
|
||||
ClearCursor()
|
||||
|
||||
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
|
||||
|
||||
+60
-52
@@ -68,7 +68,7 @@ end
|
||||
|
||||
function public.LOAD()
|
||||
m.create_frames(m, public, private)
|
||||
m.update_search()
|
||||
m.new_search('')
|
||||
m.update_tab(m.SAVED)
|
||||
m.update_auto_buy_filter()
|
||||
end
|
||||
@@ -271,8 +271,8 @@ function private.start_real_time_scan(query, search, continuation)
|
||||
queries = {query},
|
||||
auto_buy_validator = search.auto_buy_validator,
|
||||
on_scan_start = function()
|
||||
m.status_bar:update_status(99.99, 99.99)
|
||||
m.status_bar:set_text('Scanning last page ...')
|
||||
search.status_bar:update_status(99.99, 99.99)
|
||||
search.status_bar:set_text('Scanning last page ...')
|
||||
end,
|
||||
on_page_loaded = function(_, _, 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)
|
||||
end,
|
||||
on_abort = function()
|
||||
m.status_bar:update_status(100, 100)
|
||||
m.status_bar:set_text('Scan paused')
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text('Scan paused')
|
||||
|
||||
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,
|
||||
auto_buy_validator = search.auto_buy_validator,
|
||||
on_scan_start = function()
|
||||
m.status_bar:update_status(0,0)
|
||||
search.status_bar:update_status(0,0)
|
||||
if continuation then
|
||||
m.status_bar:set_text('Resuming scan...')
|
||||
search.status_bar:set_text('Resuming scan...')
|
||||
else
|
||||
m.status_bar:set_text('Scanning auctions...')
|
||||
search.status_bar:set_text('Scanning auctions...')
|
||||
end
|
||||
end,
|
||||
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 = max(total_scan_pages, 1)
|
||||
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)
|
||||
m.status_bar:set_text(format('Scanning %d / %d (Page %d / %d)', current_query, total_queries, current_page, total_scan_pages))
|
||||
search.status_bar:update_status(100 * (current_query - 1) / getn(queries), 100 * (current_page - 1) / 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,
|
||||
on_page_scanned = function()
|
||||
m.results_listing:SetDatabase()
|
||||
@@ -385,8 +385,8 @@ function private.start_search(queries, continuation)
|
||||
end
|
||||
end,
|
||||
on_complete = function()
|
||||
m.status_bar:update_status(100, 100)
|
||||
m.status_bar:set_text('Scan complete')
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text('Scan complete')
|
||||
|
||||
if m.current_search() == search and m.frame.results:IsVisible() and getn(search.records) == 0 then
|
||||
m.update_tab(m.SAVED)
|
||||
@@ -395,8 +395,8 @@ function private.start_search(queries, continuation)
|
||||
m.enable_start()
|
||||
end,
|
||||
on_abort = function()
|
||||
m.status_bar:update_status(100, 100)
|
||||
m.status_bar:set_text('Scan paused')
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text('Scan paused')
|
||||
|
||||
if current_query then
|
||||
search.continuation = {current_query, current_page + 1}
|
||||
@@ -443,24 +443,25 @@ function public.execute(resume, real_time)
|
||||
|
||||
if resume then
|
||||
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
|
||||
if m.current_search().real_time ~= real_time then
|
||||
m.results_listing:Reset()
|
||||
if 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
|
||||
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
|
||||
m.current_search().records = {}
|
||||
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_validator = m.auto_buy_filter_button:GetChecked() and m.auto_buy_validator -- some redundancy but why not to be save
|
||||
m.results_listing:SetDatabase(m.current_search().records)
|
||||
m.current_search().auto_buy_validator = m.auto_buy_filter_button:GetChecked() and m.auto_buy_validator -- some redundancy to be save
|
||||
end
|
||||
|
||||
local continuation = resume and m.current_search().continuation
|
||||
m.discard_continuation()
|
||||
m:enable_stop()
|
||||
|
||||
m.close_settings()
|
||||
m.update_tab(m.RESULTS)
|
||||
if real_time then
|
||||
m.start_real_time_scan(queries[1], nil, continuation)
|
||||
@@ -517,7 +518,7 @@ do
|
||||
state = SEARCHING
|
||||
scan_id = Aux.scan_util.find(
|
||||
record,
|
||||
m.status_bar,
|
||||
m.current_search().status_bar,
|
||||
function()
|
||||
state = IDLE
|
||||
end,
|
||||
@@ -588,28 +589,37 @@ function private.update_continuation()
|
||||
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
|
||||
local searches = { [1] = {
|
||||
filter_string = '',
|
||||
records = {},
|
||||
}}
|
||||
local searches = {}
|
||||
local search_index = 1
|
||||
|
||||
function private.current_search()
|
||||
return searches[search_index]
|
||||
end
|
||||
|
||||
function private.update_search()
|
||||
Aux.scan.abort(m.search_scan_id)
|
||||
function private.update_search(index)
|
||||
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.results_listing:Reset()
|
||||
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()
|
||||
else
|
||||
m.previous_button:Enable()
|
||||
end
|
||||
if search_index == getn(searches) or search_index == 0 then
|
||||
if search_index == getn(searches) then
|
||||
m.next_button:Hide()
|
||||
m.search_box:SetPoint('LEFT', m.previous_button, 'RIGHT', 4, 0)
|
||||
else
|
||||
@@ -620,45 +630,43 @@ do
|
||||
end
|
||||
|
||||
function private.new_search(filter_string, prettified)
|
||||
tinsert(aux_recent_searches, 1, {
|
||||
filter_string = filter_string,
|
||||
prettified = prettified,
|
||||
})
|
||||
while getn(aux_recent_searches) > 50 do
|
||||
tremove(aux_recent_searches)
|
||||
if prettified then
|
||||
tinsert(aux_recent_searches, 1, {
|
||||
filter_string = filter_string,
|
||||
prettified = prettified,
|
||||
})
|
||||
while getn(aux_recent_searches) > 50 do
|
||||
tremove(aux_recent_searches)
|
||||
end
|
||||
m.update_search_listings()
|
||||
end
|
||||
m.update_search_listings()
|
||||
|
||||
tinsert(searches, search_index + 1, {
|
||||
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
|
||||
while getn(searches) > search_index do
|
||||
tremove(searches)
|
||||
end
|
||||
tinsert(searches, {
|
||||
filter_string = filter_string,
|
||||
records = {},
|
||||
status_bar = m.new_status_bar(),
|
||||
})
|
||||
if getn(searches) > 5 then
|
||||
tremove(searches, 1)
|
||||
end
|
||||
search_index = getn(searches)
|
||||
m.update_search()
|
||||
|
||||
m.update_search(getn(searches))
|
||||
end
|
||||
|
||||
function private.previous_search()
|
||||
m.search_box:HighlightText(0, 0)
|
||||
m.search_box:ClearFocus()
|
||||
search_index = search_index - 1
|
||||
m.update_search()
|
||||
m.update_search(search_index - 1)
|
||||
m.update_tab(m.RESULTS)
|
||||
end
|
||||
|
||||
function private.next_search()
|
||||
m.search_box:HighlightText(0, 0)
|
||||
m.search_box:ClearFocus()
|
||||
search_index = search_index + 1
|
||||
m.update_search()
|
||||
m.update_search(search_index + 1)
|
||||
m.update_tab(m.RESULTS)
|
||||
end
|
||||
end
|
||||
|
||||
+8
-10
@@ -285,17 +285,15 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
||||
private.new_filter_button = btn
|
||||
end
|
||||
do
|
||||
local status_bar = Aux.gui.status_bar(m.frame)
|
||||
status_bar:SetWidth(265)
|
||||
status_bar:SetHeight(25)
|
||||
status_bar:SetPoint('TOPLEFT', AuxFrameContent, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:update_status(100, 100)
|
||||
status_bar:set_text('')
|
||||
private.status_bar = status_bar
|
||||
local frame = CreateFrame('Frame')
|
||||
frame:SetWidth(265)
|
||||
frame:SetHeight(25)
|
||||
frame:SetPoint('TOPLEFT', AuxFrameContent, 'BOTTOMLEFT', 0, -6)
|
||||
private.status_bar_frame = frame
|
||||
end
|
||||
do
|
||||
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:SetHeight(24)
|
||||
btn:SetText('Bid')
|
||||
@@ -324,7 +322,7 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
||||
end
|
||||
do
|
||||
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:SetHeight(24)
|
||||
btn:SetText('Favorite')
|
||||
@@ -341,7 +339,7 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
||||
end
|
||||
do
|
||||
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:SetHeight(24)
|
||||
btn1:SetText('Search')
|
||||
|
||||
+3
-13
@@ -84,23 +84,13 @@ function public.auction_sell_item()
|
||||
local name, texture, count, quality, usable, vendor_price = GetAuctionSellItemInfo()
|
||||
|
||||
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 {
|
||||
name = name,
|
||||
texture = texture,
|
||||
quality = quality,
|
||||
stack_size = count,
|
||||
count = count,
|
||||
usable = usable,
|
||||
vendor_price = vendor_price,
|
||||
unit_vendor_price = unit_vendor_price,
|
||||
|
||||
tooltip = tooltip,
|
||||
aux_quantity = aux_quantity,
|
||||
vendor_price = vendor_price, -- it seems for charge items this is always the price for full charges
|
||||
}
|
||||
end
|
||||
end
|
||||
@@ -328,7 +318,7 @@ function private.item_charges(tooltip)
|
||||
return 1
|
||||
end
|
||||
|
||||
function private.max_item_charges(item_id)
|
||||
function public.max_item_charges(item_id)
|
||||
return ({
|
||||
-- wizard oil
|
||||
[20744] = 5,
|
||||
|
||||
Reference in New Issue
Block a user