refactoring
This commit is contained in:
+14
-4
@@ -1,9 +1,19 @@
|
||||
aux 'auctions_tab' local scan = aux.scan
|
||||
aux_auctions_tab = module
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
TAB 'Auctions'
|
||||
|
||||
local scan = aux_scan
|
||||
|
||||
private.auction_records = t
|
||||
|
||||
function LOAD()
|
||||
create_frames()
|
||||
aux_auctions_tab_frame.create()
|
||||
end
|
||||
|
||||
function OPEN()
|
||||
@@ -51,7 +61,7 @@ end
|
||||
|
||||
function private.test(record)
|
||||
return function(index)
|
||||
local auction_info = aux.info.auction(index, 'owner')
|
||||
local auction_info = aux_info.auction(index, 'owner')
|
||||
return auction_info and auction_info.search_signature == record.search_signature
|
||||
end
|
||||
end
|
||||
@@ -67,7 +77,7 @@ do
|
||||
|
||||
scan.abort(scan_id)
|
||||
state = SEARCHING
|
||||
scan_id = aux.scan_util.find(
|
||||
scan_id = aux_scan_util.find(
|
||||
record,
|
||||
status_bar,
|
||||
function() state = IDLE end,
|
||||
|
||||
+10
-7
@@ -1,18 +1,21 @@
|
||||
aux 'auctions_tab' local gui, auction_listing = aux.gui, aux.auction_listing
|
||||
aux_auctions_tab_frame = module
|
||||
|
||||
function private.create_frames()
|
||||
private.frame = CreateFrame('Frame', nil, aux_frame)
|
||||
local gui, auction_listing = aux_gui, aux_auction_listing
|
||||
|
||||
function public.create()
|
||||
setfenv(1, getfenv(2))
|
||||
private.frame = CreateFrame('Frame', nil, AuxFrame)
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
frame.listing = gui.panel(frame)
|
||||
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
|
||||
frame.listing:SetPoint('BOTTOMLEFT', aux_frame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMRIGHT', aux_frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMRIGHT', AuxFrame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
|
||||
private.listing = auction_listing.CreateAuctionResultsTable(frame.listing, auction_listing.auctions_config)
|
||||
listing:SetSort(1,2,3,4,5,6,7,8)
|
||||
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
|
||||
listing:Reset()
|
||||
listing:SetHandler('OnCellClick', function(cell, button)
|
||||
if IsAltKeyDown() and listing:GetSelection().record == cell.row.data.record and cancel_button:IsEnabled() then
|
||||
@@ -28,7 +31,7 @@ function private.create_frames()
|
||||
private.status_bar = gui.status_bar(frame)
|
||||
status_bar:SetWidth(265)
|
||||
status_bar:SetHeight(25)
|
||||
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:update_status(100, 100)
|
||||
status_bar:set_text('')
|
||||
end
|
||||
|
||||
+15
-5
@@ -1,9 +1,19 @@
|
||||
aux 'bids_tab' local scan = aux.scan
|
||||
aux_bids_tab = module
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
TAB 'Bids'
|
||||
|
||||
local scan = aux_scan
|
||||
|
||||
private.auction_records = t
|
||||
|
||||
function LOAD()
|
||||
create_frames()
|
||||
aux_bids_tab_frame.create()
|
||||
end
|
||||
|
||||
function OPEN()
|
||||
@@ -51,7 +61,7 @@ end
|
||||
|
||||
function private.test(record)
|
||||
return function(index)
|
||||
local auction_info = aux.info.auction(index, 'bidder')
|
||||
local auction_info = aux_info.auction(index, 'bidder')
|
||||
return auction_info and auction_info.search_signature == record.search_signature
|
||||
end
|
||||
end
|
||||
@@ -67,7 +77,7 @@ do
|
||||
|
||||
scan.abort(scan_id)
|
||||
state = SEARCHING
|
||||
scan_id = aux.scan_util.find(
|
||||
scan_id = aux_scan_util.find(
|
||||
record,
|
||||
status_bar,
|
||||
function() state = IDLE end,
|
||||
@@ -83,7 +93,7 @@ do
|
||||
bid_button:SetScript('OnClick', function()
|
||||
if test(record)(index) and listing:ContainsRecord(record) then
|
||||
place_bid('bidder', index, record.bid_price, record.bid_price < record.buyout_price and function()
|
||||
aux.info.bid_update(record)
|
||||
aux_info.bid_update(record)
|
||||
listing:SetDatabase()
|
||||
end or papply(listing.RemoveAuctionRecord, listing, record))
|
||||
end
|
||||
|
||||
+10
-7
@@ -1,18 +1,21 @@
|
||||
aux 'bids_tab' local gui, auction_listing = aux.gui, aux.auction_listing
|
||||
aux_bids_tab_frame = module
|
||||
|
||||
function private.create_frames()
|
||||
private.frame = CreateFrame('Frame', nil, aux_frame)
|
||||
local gui, auction_listing = aux_gui, aux_auction_listing
|
||||
|
||||
function public.create()
|
||||
setfenv(1, getfenv(2))
|
||||
private.frame = CreateFrame('Frame', nil, AuxFrame)
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
frame.listing = gui.panel(frame)
|
||||
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
|
||||
frame.listing:SetPoint('BOTTOMLEFT', aux_frame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMRIGHT', aux_frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMRIGHT', AuxFrame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
|
||||
private.listing = auction_listing.CreateAuctionResultsTable(frame.listing, auction_listing.bids_config)
|
||||
listing:SetSort(1,2,3,4,5,6,7,8)
|
||||
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
|
||||
listing:Reset()
|
||||
listing:SetHandler('OnCellClick', function(cell, button)
|
||||
if IsAltKeyDown() and listing:GetSelection().record == cell.row.data.record then
|
||||
@@ -32,7 +35,7 @@ function private.create_frames()
|
||||
private.status_bar = gui.status_bar(frame)
|
||||
status_bar:SetWidth(265)
|
||||
status_bar:SetHeight(25)
|
||||
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:update_status(100, 0)
|
||||
status_bar:set_text('')
|
||||
end
|
||||
|
||||
+28
-18
@@ -1,4 +1,14 @@
|
||||
aux 'post_tab' local scan, scan_util, history, info, persistence, item_listing, al, sorting = aux.scan, aux.scan_util, aux.history, aux.info, aux.persistence, aux.item_listing, aux.auction_listing, aux.sorting
|
||||
aux_post_tab = module
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
TAB 'Post'
|
||||
|
||||
local scan, scan_util, history, info, persistence, item_listing, al, sorting = aux_scan, aux_scan_util, aux_history, aux_info, aux_persistence, aux_item_listing, aux_auction_listing, aux_sorting
|
||||
|
||||
|
||||
local DURATION_4, DURATION_8, DURATION_24 = 120, 480, 1440
|
||||
@@ -33,7 +43,7 @@ end
|
||||
local scan_id, inventory_records, existing_auctions = 0, t, t
|
||||
|
||||
function private.refresh_button_click()
|
||||
aux.scan.abort(scan_id)
|
||||
aux_scan.abort(scan_id)
|
||||
refresh_entries()
|
||||
refresh = true
|
||||
end
|
||||
@@ -51,7 +61,7 @@ do
|
||||
end
|
||||
|
||||
function LOAD()
|
||||
create_frames()
|
||||
aux_post_tab_frame.create()
|
||||
end
|
||||
|
||||
function OPEN()
|
||||
@@ -71,20 +81,20 @@ end
|
||||
|
||||
function private.get_unit_start_price()
|
||||
local money_text = unit_start_price:GetText()
|
||||
return aux.money.from_string(money_text) or 0
|
||||
return aux_money.from_string(money_text) or 0
|
||||
end
|
||||
|
||||
function private.set_unit_start_price(amount)
|
||||
unit_start_price:SetText(aux.money.to_string(amount, true, nil, 3, nil, true))
|
||||
unit_start_price:SetText(aux_money.to_string(amount, true, nil, 3, nil, true))
|
||||
end
|
||||
|
||||
function private.get_unit_buyout_price()
|
||||
local money_text = unit_buyout_price:GetText()
|
||||
return aux.money.from_string(money_text) or 0
|
||||
return aux_money.from_string(money_text) or 0
|
||||
end
|
||||
|
||||
function private.set_unit_buyout_price(amount)
|
||||
unit_buyout_price:SetText(aux.money.to_string(amount, true, nil, 3, nil, true))
|
||||
unit_buyout_price:SetText(aux_money.to_string(amount, true, nil, 3, nil, true))
|
||||
end
|
||||
|
||||
function private.update_inventory_listing()
|
||||
@@ -105,12 +115,12 @@ function private.update_auction_listing()
|
||||
for i, auction_record in existing_auctions[selected_item.key] or tt do
|
||||
|
||||
local blizzard_bid_undercut, buyout_price_undercut = undercut(auction_record, stack_size_slider:GetValue())
|
||||
blizzard_bid_undercut = aux.money.from_string(aux.money.to_string(blizzard_bid_undercut, true, nil, 3))
|
||||
buyout_price_undercut = aux.money.from_string(aux.money.to_string(buyout_price_undercut, true, nil, 3))
|
||||
blizzard_bid_undercut = aux_money.from_string(aux_money.to_string(blizzard_bid_undercut, true, nil, 3))
|
||||
buyout_price_undercut = aux_money.from_string(aux_money.to_string(buyout_price_undercut, true, nil, 3))
|
||||
|
||||
local stack_blizzard_bid_undercut, stack_buyout_price_undercut = undercut(auction_record, stack_size_slider:GetValue(), true)
|
||||
stack_blizzard_bid_undercut = aux.money.from_string(aux.money.to_string(stack_blizzard_bid_undercut, true, nil, 3))
|
||||
stack_buyout_price_undercut = aux.money.from_string(aux.money.to_string(stack_buyout_price_undercut, true, nil, 3))
|
||||
stack_blizzard_bid_undercut = aux_money.from_string(aux_money.to_string(stack_blizzard_bid_undercut, true, nil, 3))
|
||||
stack_buyout_price_undercut = aux_money.from_string(aux_money.to_string(stack_buyout_price_undercut, true, nil, 3))
|
||||
|
||||
local stack_size = stack_size_slider:GetValue()
|
||||
local historical_value = history.value(selected_item.key)
|
||||
@@ -138,9 +148,9 @@ function private.update_auction_listing()
|
||||
{value=auction_record.own and color.yellow(auction_record.count) or auction_record.count},
|
||||
{value=al.time_left(auction_record.duration)},
|
||||
{value=auction_record.stack_size == stack_size and color.yellow(auction_record.stack_size) or auction_record.stack_size},
|
||||
{value=aux.money.to_string(auction_record.unit_blizzard_bid, true, nil, 3, bid_color)},
|
||||
{value=aux_money.to_string(auction_record.unit_blizzard_bid, true, nil, 3, bid_color)},
|
||||
{value=historical_value and al.percentage_historical(round(auction_record.unit_blizzard_bid / historical_value * 100)) or '---'},
|
||||
{value=auction_record.unit_buyout_price > 0 and aux.money.to_string(auction_record.unit_buyout_price, true, nil, 3, buyout_color) or '---'},
|
||||
{value=auction_record.unit_buyout_price > 0 and aux_money.to_string(auction_record.unit_buyout_price, true, nil, 3, buyout_color) or '---'},
|
||||
{value=auction_record.unit_buyout_price > 0 and historical_value and al.percentage_historical(round(auction_record.unit_buyout_price / historical_value * 100)) or '---'},
|
||||
},
|
||||
record = auction_record,
|
||||
@@ -214,7 +224,7 @@ function private.post_auctions()
|
||||
duration_code = 4
|
||||
end
|
||||
|
||||
aux.post.start(
|
||||
aux_post.start(
|
||||
key,
|
||||
stack_size,
|
||||
duration,
|
||||
@@ -307,7 +317,7 @@ function private.update_item_configuration()
|
||||
local deposit_factor = neutral_faction() and .25 or .05
|
||||
local stack_size, stack_count = stack_size_slider:GetValue(), stack_count_slider:GetValue()
|
||||
local amount = floor(selected_item.unit_vendor_price * deposit_factor * (selected_item.max_charges and 1 or stack_size)) * stack_count * UIDropDownMenu_GetSelectedValue(duration_dropdown) / 120
|
||||
deposit:SetText('Deposit: ' .. aux.money.to_string(amount, nil, nil, nil, inline_color.text.enabled))
|
||||
deposit:SetText('Deposit: ' .. aux_money.to_string(amount, nil, nil, nil, inline_color.text.enabled))
|
||||
end
|
||||
|
||||
refresh_button:Enable()
|
||||
@@ -359,7 +369,7 @@ function private.update_historical_value_button()
|
||||
if selected_item then
|
||||
local historical_value = history.value(selected_item.key)
|
||||
historical_value_button.amount = historical_value
|
||||
historical_value_button:SetText(historical_value and aux.money.to_string(historical_value, true, nil, 3) or '---')
|
||||
historical_value_button:SetText(historical_value and aux_money.to_string(historical_value, true, nil, 3) or '---')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -387,8 +397,8 @@ function private.set_item(item)
|
||||
stack_size_slider:SetValue(settings.stack_size)
|
||||
quantity_update(true)
|
||||
|
||||
unit_start_price:SetText(aux.money.to_string(settings.start_price, true, nil, 3, nil, true))
|
||||
unit_buyout_price:SetText(aux.money.to_string(settings.buyout_price, true, nil, 3, nil, true))
|
||||
unit_start_price:SetText(aux_money.to_string(settings.start_price, true, nil, 3, nil, true))
|
||||
unit_buyout_price:SetText(aux_money.to_string(settings.buyout_price, true, nil, 3, nil, true))
|
||||
|
||||
if not existing_auctions[selected_item.key] then
|
||||
refresh_entries()
|
||||
|
||||
+11
-8
@@ -1,15 +1,18 @@
|
||||
aux 'post_tab' local gui, listing, item_listing, money, search_tab = aux.gui, aux.listing, aux.item_listing, aux.money, aux.search_tab
|
||||
aux_post_tab_frame = module
|
||||
|
||||
function private.create_frames()
|
||||
private.frame = CreateFrame('Frame', nil, aux_frame)
|
||||
local gui, listing, item_listing, money, search_tab = aux_gui, aux_listing, aux_item_listing, aux_money, aux_search_tab
|
||||
|
||||
function public.create()
|
||||
setfenv(1, getfenv(2))
|
||||
private.frame = CreateFrame('Frame', nil, AuxFrame)
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
frame.content = CreateFrame('Frame', nil, frame)
|
||||
frame.content:SetPoint('TOP', frame, 'TOP', 0, -8)
|
||||
frame.content:SetPoint('BOTTOMLEFT', aux_frame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.content:SetPoint('BOTTOMRIGHT', aux_frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
frame.content:SetPoint('BOTTOMLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.content:SetPoint('BOTTOMRIGHT', AuxFrame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
|
||||
frame.inventory = gui.panel(frame.content)
|
||||
frame.inventory:SetWidth(212)
|
||||
@@ -47,7 +50,7 @@ function private.create_frames()
|
||||
set_item(this.item_record)
|
||||
elseif arg1 == 'RightButton' then
|
||||
tab = 1
|
||||
search_tab.set_filter(strlower(aux.info.item(this.item_record.item_id).name) .. '/exact')
|
||||
search_tab.set_filter(strlower(aux_info.item(this.item_record.item_id).name) .. '/exact')
|
||||
search_tab.execute(nil, false)
|
||||
end
|
||||
end,
|
||||
@@ -84,7 +87,7 @@ function private.create_frames()
|
||||
private.status_bar = gui.status_bar(frame)
|
||||
status_bar:SetWidth(265)
|
||||
status_bar:SetHeight(25)
|
||||
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:update_status(100, 100)
|
||||
status_bar:set_text('')
|
||||
end
|
||||
@@ -107,7 +110,7 @@ function private.create_frames()
|
||||
item:SetPoint('TOPLEFT', 10, -6)
|
||||
item.button:SetScript('OnEnter', function()
|
||||
if selected_item then
|
||||
aux.info.set_tooltip(selected_item.itemstring, this, 'ANCHOR_RIGHT')
|
||||
aux_info.set_tooltip(selected_item.itemstring, this, 'ANCHOR_RIGHT')
|
||||
end
|
||||
end)
|
||||
item.button:SetScript('OnLeave', function()
|
||||
|
||||
+16
-8
@@ -1,13 +1,21 @@
|
||||
aux 'search_tab' local scan, scan_util = aux.scan, aux.scan_util
|
||||
aux_search_tab = module
|
||||
|
||||
StaticPopupDialogs['AUX_SEARCH_TABLE_FULL'] = {
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
TAB 'Search'
|
||||
|
||||
StaticPopupDialogs.AUX_SEARCH_TABLE_FULL = {
|
||||
text = 'Table full!\nFurther results from this search will still be processed but no longer displayed in the table.',
|
||||
button1 = 'Ok',
|
||||
showAlert = 1,
|
||||
timeout = 0,
|
||||
hideOnEscape = 1,
|
||||
}
|
||||
StaticPopupDialogs['AUX_SEARCH_AUTO_BUY'] = {
|
||||
StaticPopupDialogs.AUX_SEARCH_AUTO_BUY = {
|
||||
text = 'Are you sure you want to activate automatic buyout?',
|
||||
button1 = 'Yes',
|
||||
button2 = 'No',
|
||||
@@ -20,10 +28,10 @@ StaticPopupDialogs['AUX_SEARCH_AUTO_BUY'] = {
|
||||
do
|
||||
local function action()
|
||||
aux_auto_buy_filter = _G[this:GetParent():GetName() .. 'EditBox']:GetText()
|
||||
update_auto_buy_filter()
|
||||
aux_search_tab_results.update_auto_buy_filter()
|
||||
end
|
||||
|
||||
StaticPopupDialogs['AUX_SEARCH_AUTO_BUY_FILTER'] = {
|
||||
StaticPopupDialogs.AUX_SEARCH_AUTO_BUY_FILTER = {
|
||||
text = 'Enter a filter for automatic buyout.',
|
||||
button1 = 'Accept',
|
||||
button2 = 'Cancel',
|
||||
@@ -52,10 +60,10 @@ private.SAVED = 2
|
||||
private.FILTER = 3
|
||||
|
||||
function LOAD()
|
||||
create_frames()
|
||||
aux_search_tab_frame.create()
|
||||
subtab = SAVED
|
||||
update_auto_buy_filter()
|
||||
new_search('')
|
||||
aux_search_tab_results.update_auto_buy_filter()
|
||||
aux_search_tab_results.new_search('')
|
||||
current_search.placeholder = true
|
||||
end
|
||||
|
||||
|
||||
+14
-6
@@ -1,4 +1,12 @@
|
||||
aux 'search_tab' local filter_util = aux.filter_util
|
||||
aux_search_tab_filter = module
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
local filter_util = aux_filter_util
|
||||
|
||||
function private.valid_level(str)
|
||||
local level = tonumber(str)
|
||||
@@ -73,7 +81,7 @@ function private.update_form()
|
||||
|
||||
if blizzard_query.exact then
|
||||
for key in temp-S('class', 'subclass', 'slot', 'quality') do
|
||||
_E[key .. '_dropdown'].button:Disable()
|
||||
_M[key .. '_dropdown'].button:Disable()
|
||||
end
|
||||
else
|
||||
class_dropdown.button:Enable()
|
||||
@@ -81,9 +89,9 @@ function private.update_form()
|
||||
end
|
||||
for key in temp-S('min_level', 'max_level') do
|
||||
if blizzard_query.exact then
|
||||
_E[key .. '_input']:EnableMouse(false)
|
||||
_M[key .. '_input']:EnableMouse(false)
|
||||
else
|
||||
_E[key .. '_input']:EnableMouse(true)
|
||||
_M[key .. '_input']:EnableMouse(true)
|
||||
end
|
||||
end
|
||||
if blizzard_query.exact then
|
||||
@@ -210,9 +218,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 .. ']'
|
||||
parameter = aux_info.display_name(aux_cache.item_id(parameter)) or '[' .. parameter .. ']'
|
||||
elseif filter_util.filters[component[2]].input_type == 'money' then
|
||||
parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true)
|
||||
parameter = aux_money.to_string(aux_money.from_string(parameter), nil, true)
|
||||
end
|
||||
component_text = component_text .. filter_color(': ') .. parameter
|
||||
end
|
||||
|
||||
+18
-15
@@ -1,21 +1,24 @@
|
||||
aux 'search_tab' local gui, completion, listing, auction_listing, filter_util = aux.gui, aux.completion, aux.listing, aux.auction_listing, aux.filter_util
|
||||
aux_search_tab_frame = module
|
||||
|
||||
FILTER_SPACING = 28.5
|
||||
local gui, completion, listing, auction_listing, filter_util = aux_gui, aux_completion, aux_listing, aux_auction_listing, aux_filter_util
|
||||
|
||||
function private.create_frames()
|
||||
private.frame = CreateFrame('Frame', nil, aux_frame)
|
||||
local FILTER_SPACING = 28.5
|
||||
|
||||
function public.create()
|
||||
setfenv(1, getfenv(2))
|
||||
private.frame = CreateFrame('Frame', nil, AuxFrame)
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
frame.filter = gui.panel(frame)
|
||||
frame.filter:SetAllPoints(aux_frame.content)
|
||||
frame.filter:SetAllPoints(AuxFrame.content)
|
||||
|
||||
frame.results = gui.panel(frame)
|
||||
frame.results:SetAllPoints(aux_frame.content)
|
||||
frame.results:SetAllPoints(AuxFrame.content)
|
||||
|
||||
frame.saved = CreateFrame('Frame', nil, frame)
|
||||
frame.saved:SetAllPoints(aux_frame.content)
|
||||
frame.saved:SetAllPoints(AuxFrame.content)
|
||||
|
||||
frame.saved.favorite = gui.panel(frame.saved)
|
||||
frame.saved.favorite:SetWidth(378.5)
|
||||
@@ -149,9 +152,9 @@ function private.create_frames()
|
||||
btn:SetScript('OnClick', function()
|
||||
if this:GetChecked() then
|
||||
this:SetChecked(false)
|
||||
aux_auto_buy_filter = nil
|
||||
aux_search_tab_results.aux_auto_buy_filter = nil
|
||||
this.prettified = nil
|
||||
auto_buy_validator = nil
|
||||
aux_search_tab_results.auto_buy_validator = nil
|
||||
else
|
||||
StaticPopup_Show('AUX_SEARCH_AUTO_BUY_FILTER')
|
||||
end
|
||||
@@ -208,7 +211,7 @@ function private.create_frames()
|
||||
btn:SetHeight(25)
|
||||
btn:SetText('Stop')
|
||||
btn:SetScript('OnClick', function()
|
||||
aux.scan.abort(search_scan_id)
|
||||
aux_scan.abort(aux_search_tab_results.search_scan_id)
|
||||
end)
|
||||
private.stop_button = btn
|
||||
end
|
||||
@@ -227,7 +230,7 @@ function private.create_frames()
|
||||
local editbox = gui.editbox(controls)
|
||||
editbox:EnableMouse(1)
|
||||
editbox.formatter = function(str)
|
||||
local queries = aux.filter_util.queries(str)
|
||||
local queries = aux_filter_util.queries(str)
|
||||
return queries and join(map(copy(queries), function(query) return query.prettified end), ';') or color.red(str)
|
||||
end
|
||||
editbox.complete = completion.complete_filter
|
||||
@@ -247,7 +250,7 @@ function private.create_frames()
|
||||
end
|
||||
do
|
||||
local btn = gui.button(frame, gui.font_size.large)
|
||||
btn:SetPoint('BOTTOMLEFT', aux_frame.content, 'TOPLEFT', 10, 8)
|
||||
btn:SetPoint('BOTTOMLEFT', AuxFrame.content, 'TOPLEFT', 10, 8)
|
||||
btn:SetWidth(243)
|
||||
btn:SetHeight(22)
|
||||
btn:SetText('Search Results')
|
||||
@@ -276,7 +279,7 @@ function private.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', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
|
||||
private.status_bar_frame = frame
|
||||
end
|
||||
do
|
||||
@@ -583,8 +586,8 @@ function private.create_frames()
|
||||
private.filter_display = scroll_child
|
||||
end
|
||||
|
||||
private.status_bars = t
|
||||
private.tables = t
|
||||
public.status_bars = t
|
||||
public.tables = t
|
||||
for _ = 1, 5 do
|
||||
local status_bar = gui.status_bar(frame)
|
||||
status_bar:SetAllPoints(status_bar_frame)
|
||||
|
||||
+23
-15
@@ -1,16 +1,24 @@
|
||||
aux 'search_tab' local info, scan = aux.info, aux.scan
|
||||
aux_search_tab_results = module
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
local info, scan = aux_info, aux_scan
|
||||
|
||||
aux_auto_buy_filter = ''
|
||||
|
||||
do
|
||||
local id = 0
|
||||
function private.search_scan_id.get() return id end
|
||||
function private.search_scan_id.set(v) id = v end
|
||||
function public.search_scan_id.get() return id end
|
||||
function public.search_scan_id.set(v) id = v end
|
||||
end
|
||||
do
|
||||
local validator
|
||||
function private.auto_buy_validator.get() return validator end
|
||||
function private.auto_buy_validator.set(v) validator = v end
|
||||
function public.auto_buy_validator.get() return validator end
|
||||
function public.auto_buy_validator.set(v) validator = v end
|
||||
end
|
||||
|
||||
do
|
||||
@@ -46,7 +54,7 @@ do
|
||||
update_continuation()
|
||||
end
|
||||
|
||||
function private.new_search(filter_string)
|
||||
function public.new_search(filter_string)
|
||||
while getn(searches) > search_index do
|
||||
tremove(searches)
|
||||
end
|
||||
@@ -54,16 +62,16 @@ do
|
||||
tinsert(searches, search)
|
||||
if getn(searches) > 5 then
|
||||
tremove(searches, 1)
|
||||
tinsert(status_bars, tremove(status_bars, 1))
|
||||
tinsert(tables, tremove(tables, 1))
|
||||
tinsert(aux_search_tab.status_bars, tremove(aux_search_tab.status_bars, 1))
|
||||
tinsert(aux_search_tab.tables, tremove(aux_search_tab.tables, 1))
|
||||
search_index = 4
|
||||
end
|
||||
|
||||
search.status_bar = status_bars[getn(searches)]
|
||||
search.status_bar = aux_search_tab.status_bars[getn(searches)]
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text('')
|
||||
|
||||
search.table = tables[getn(searches)]
|
||||
search.table = aux_search_tab.tables[getn(searches)]
|
||||
search.table:SetSort(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
||||
search.table:Reset()
|
||||
search.table:SetDatabase(search.records)
|
||||
@@ -116,9 +124,9 @@ function update_start_stop()
|
||||
end
|
||||
end
|
||||
|
||||
function private.update_auto_buy_filter()
|
||||
function public.update_auto_buy_filter()
|
||||
if aux_auto_buy_filter ~= '' then
|
||||
local queries, error = aux.filter_util.queries(aux_auto_buy_filter)
|
||||
local queries, error = aux_filter_util.queries(aux_auto_buy_filter)
|
||||
if queries then
|
||||
if getn(queries) > 1 then
|
||||
print 'Error: The automatic buyout filter does not support multi-queries'
|
||||
@@ -312,7 +320,7 @@ function public.execute(resume, real_time)
|
||||
end
|
||||
local filter_string = search_box:GetText()
|
||||
|
||||
local queries, error = aux.filter_util.queries(filter_string)
|
||||
local queries, error = aux_filter_util.queries(filter_string)
|
||||
if not queries then
|
||||
print('Invalid filter:', error)
|
||||
return
|
||||
@@ -338,7 +346,7 @@ function public.execute(resume, real_time)
|
||||
else
|
||||
new_search(filter_string)
|
||||
end
|
||||
new_recent_search(filter_string, join(map(copy(queries), function(filter) return filter.prettified end), ';'))
|
||||
aux_search_tab_saved.new_recent_search(filter_string, join(map(copy(queries), function(filter) return filter.prettified end), ';'))
|
||||
else
|
||||
current_search.records = t
|
||||
current_search.table:SetDatabase(current_search.records)
|
||||
@@ -390,7 +398,7 @@ do
|
||||
|
||||
scan.abort(scan_id)
|
||||
state = SEARCHING
|
||||
scan_id = aux.scan_util.find(
|
||||
scan_id = aux_scan_util.find(
|
||||
record,
|
||||
current_search.status_bar,
|
||||
function()
|
||||
|
||||
+10
-4
@@ -1,4 +1,10 @@
|
||||
aux 'search_tab'
|
||||
aux_search_tab_saved = module
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
aux_favorite_searches = t
|
||||
aux_recent_searches = t
|
||||
@@ -13,7 +19,7 @@ function private.update_search_listings()
|
||||
index = i,
|
||||
})
|
||||
end
|
||||
favorite_searches_listing:SetData(favorite_search_rows)
|
||||
aux_search_tab.favorite_searches_listing:SetData(favorite_search_rows)
|
||||
|
||||
local recent_search_rows = t
|
||||
for i, recent_search in aux_recent_searches do
|
||||
@@ -24,10 +30,10 @@ function private.update_search_listings()
|
||||
index = i,
|
||||
})
|
||||
end
|
||||
recent_searches_listing:SetData(recent_search_rows)
|
||||
aux_search_tab.recent_searches_listing:SetData(recent_search_rows)
|
||||
end
|
||||
|
||||
function private.new_recent_search(filter_string, prettified)
|
||||
function public.new_recent_search(filter_string, prettified)
|
||||
tinsert(aux_recent_searches, 1, {
|
||||
filter_string = filter_string,
|
||||
prettified = prettified,
|
||||
|
||||
Reference in New Issue
Block a user