refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-23 04:58:46 +02:00
parent 85d2e578e4
commit 5f03b95e8f
26 changed files with 209 additions and 225 deletions
-1
View File
@@ -1,5 +1,4 @@
module 'auctions_tab'
tab(3, 'Auctions')
auction_records = nil
+4 -4
View File
@@ -1,4 +1,4 @@
module 'auctions_tab' import 'gui'
module 'auctions_tab' import 'gui' 'auction_listing'
function create_frames()
frame = CreateFrame('Frame', nil, aux_frame)
@@ -8,8 +8,8 @@ function create_frames()
frame.listing = gui.panel(frame)
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.listing:SetPoint('BOTTOMLEFT', frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', frame.content, 'BOTTOMRIGHT', 0, 0)
frame.listing:SetPoint('BOTTOMLEFT', aux_frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', aux_frame.content, 'BOTTOMRIGHT', 0, 0)
listing = auction_listing.CreateAuctionResultsTable(frame.listing, auction_listing.auctions_config)
listing:SetSort(1,2,3,4,5,6,7,8)
@@ -28,7 +28,7 @@ function create_frames()
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(100, 100)
status_bar:set_text('')
end
-1
View File
@@ -1,5 +1,4 @@
module 'bids_tab'
tab(4, 'Bids')
auction_records = nil
+4 -4
View File
@@ -1,4 +1,4 @@
module 'bids_tab' import 'gui'
module 'bids_tab' import 'gui' 'auction_listing'
function create_frames()
frame = CreateFrame('Frame', nil, aux_frame)
@@ -8,8 +8,8 @@ function create_frames()
frame.listing = gui.panel(frame)
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.listing:SetPoint('BOTTOMLEFT', frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', frame.content, 'BOTTOMRIGHT', 0, 0)
frame.listing:SetPoint('BOTTOMLEFT', aux_frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', aux_frame.content, 'BOTTOMRIGHT', 0, 0)
listing = auction_listing.CreateAuctionResultsTable(frame.listing, auction_listing.bids_config)
listing:SetSort(1,2,3,4,5,6,7,8)
@@ -32,7 +32,7 @@ function create_frames()
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(100, 0)
status_bar:set_text('')
end
-1
View File
@@ -1,5 +1,4 @@
module 'post_tab'
tab(2, 'Post')
local DURATION_4, DURATION_8, DURATION_24 = 120, 480, 1440
local settings_schema = {'record', '#', {stack_size='number'}, {duration='number'}, {start_price='number'}, {buyout_price='number'}, {hidden='boolean'}}
+7 -7
View File
@@ -1,4 +1,4 @@
module 'post_tab' import 'gui'
module 'post_tab' import [''] 'core' 'gui' 'listing' 'item_listing' 'money'
function create_frames()
frame = CreateFrame('Frame', nil, aux_frame)
@@ -8,20 +8,20 @@ function create_frames()
frame.content = CreateFrame('Frame', nil, frame)
frame.content:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.content:SetPoint('BOTTOMLEFT', frame.content, 'BOTTOMLEFT', 0, 0)
frame.content:SetPoint('BOTTOMRIGHT', frame.content, 'BOTTOMRIGHT', 0, 0)
frame.content:SetPoint('BOTTOMLEFT', aux_frame.content, 'BOTTOMLEFT', 0, 0)
frame.content:SetPoint('BOTTOMRIGHT', aux_frame.content, 'BOTTOMRIGHT', 0, 0)
frame.inventory = gui.panel(frame.content)
frame.inventory = gui.panel(aux_frame.content)
frame.inventory:SetWidth(212)
frame.inventory:SetPoint('TOPLEFT', 0, 0)
frame.inventory:SetPoint('BOTTOMLEFT', 0, 0)
frame.parameters = gui.panel(frame.content)
frame.parameters = gui.panel(aux_frame.content)
frame.parameters:SetHeight(173)
frame.parameters:SetPoint('TOPLEFT', frame.inventory, 'TOPRIGHT', 2.5, 0)
frame.parameters:SetPoint('TOPRIGHT', 0, 0)
frame.auctions = gui.panel(frame.content)
frame.auctions = gui.panel(aux_frame.content)
frame.auctions:SetHeight(228)
frame.auctions:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', 2.5, 0)
frame.auctions:SetPoint('BOTTOMRIGHT', 0, 0)
@@ -84,7 +84,7 @@ function create_frames()
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(100, 100)
status_bar:set_text('')
end
-1
View File
@@ -1,5 +1,4 @@
module 'search_tab'
tab(1, 'Search')
StaticPopupDialogs['AUX_SEARCH_TABLE_FULL'] = {
text = 'Table full!\nFurther results from this search will still be processed but no longer displayed in the table.',
+6 -6
View File
@@ -1,4 +1,4 @@
module 'search_tab' import 'gui'
module 'search_tab' import 'gui' [''] 'core' 'completion' 'listing' 'auction_listing'
FILTER_SPACING = 28.5
@@ -9,13 +9,13 @@ function create_frames()
frame:Hide()
frame.filter = gui.panel(frame)
frame.filter:SetAllPoints(frame.content)
frame.filter:SetAllPoints(aux_frame.content)
frame.results = gui.panel(frame)
frame.results:SetAllPoints(frame.content)
frame.results:SetAllPoints(aux_frame.content)
frame.saved = CreateFrame('Frame', nil, frame)
frame.saved:SetAllPoints(frame.content)
frame.saved:SetAllPoints(aux_frame.content)
frame.saved.favorite = gui.panel(frame.saved)
frame.saved.favorite:SetWidth(378.5)
@@ -243,7 +243,7 @@ function create_frames()
end
do
local btn = gui.button(frame, gui.font_size.large2)
btn:SetPoint('BOTTOMLEFT', frame.content, 'TOPLEFT', 10, 8)
btn:SetPoint('BOTTOMLEFT', aux_frame.content, 'TOPLEFT', 10, 8)
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText 'Search Results'
@@ -272,7 +272,7 @@ function create_frames()
local frame = CreateFrame('Frame', nil, frame)
frame:SetWidth(265)
frame:SetHeight(25)
frame:SetPoint('TOPLEFT', frame.content, 'BOTTOMLEFT', 0, -6)
frame:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
status_bar_frame = frame
end
do
+13 -13
View File
@@ -116,9 +116,9 @@ function update_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')
log 'Error: The automatic buyout filter does not support multi-queries'
elseif size(queries[1].blizzard_query) > 0 then
log('Error: The automatic buyout filter does not support Blizzard filters')
log 'Error: The automatic buyout filter does not support Blizzard filters'
else
auto_buy_validator = queries[1].validator
auto_buy_filter_button.prettified = queries[1].prettified
@@ -168,20 +168,20 @@ function start_real_time_scan(query, search, continuation)
end
end,
on_complete = function()
local map = {}
local map = tt
for _, record in search.records do
map[record.sniping_signature] = record
end
for _, record in new_records do
map[record.sniping_signature] = record
end
new_records = {}
new_records = t
for _, record in map do
tinsert(new_records, record)
end
if getn(new_records) > 1000 then
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
StaticPopup_Show 'AUX_SEARCH_TABLE_FULL'
else
search.records = new_records
search.table:SetDatabase(search.records)
@@ -193,7 +193,7 @@ function start_real_time_scan(query, search, continuation)
end,
on_abort = function()
search.status_bar:update_status(100, 100)
search.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
@@ -233,9 +233,9 @@ function start_search(queries, continuation)
on_scan_start = function()
search.status_bar:update_status(0,0)
if continuation then
search.status_bar:set_text('Resuming scan...')
search.status_bar:set_text 'Resuming scan...'
else
search.status_bar:set_text('Scanning auctions...')
search.status_bar:set_text 'Scanning auctions...'
end
end,
on_page_loaded = function(_, total_scan_pages)
@@ -261,13 +261,13 @@ function start_search(queries, continuation)
elseif getn(search.records) < 1000 then
tinsert(search.records, auction_record)
if getn(search.records) == 1000 then
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
StaticPopup_Show 'AUX_SEARCH_TABLE_FULL'
end
end
end,
on_complete = function()
search.status_bar:update_status(100, 100)
search.status_bar:set_text('Scan complete')
search.status_bar:set_text 'Scan complete'
if current_search == search and frame.results:IsVisible() and getn(search.records) == 0 then
set_tab(SAVED)
@@ -278,7 +278,7 @@ function start_search(queries, continuation)
end,
on_abort = function()
search.status_bar:update_status(100, 100)
search.status_bar:set_text('Scan paused')
search.status_bar:set_text 'Scan paused'
if current_query then
search.continuation = {current_query, current_page + 1}
@@ -313,10 +313,10 @@ function public.execute(resume, real_time)
return
elseif real_time then
if getn(queries) > 1 then
log('Invalid filter: The real time mode does not support multiple queries')
log 'Error: The real time mode does not support multi-queries'
return
elseif queries[1].blizzard_query.first_page or queries[1].blizzard_query.last_page then
log('Invalid filter: The real time mode does not support page range filters')
log 'Error: The real time mode does not support page ranges'
return
end
end