refactoring
This commit is contained in:
@@ -40,7 +40,7 @@ do
|
||||
btn:SetPoint('TOPLEFT', 5, -8)
|
||||
btn:SetWidth(30)
|
||||
btn:SetHeight(25)
|
||||
btn:SetText'<'
|
||||
btn:SetText('<')
|
||||
btn:SetScript('OnClick', previous_search)
|
||||
previous_button = btn
|
||||
end
|
||||
@@ -49,7 +49,7 @@ do
|
||||
btn:SetPoint('LEFT', previous_button, 'RIGHT', 4, 0)
|
||||
btn:SetWidth(30)
|
||||
btn:SetHeight(25)
|
||||
btn:SetText'>'
|
||||
btn:SetText('>')
|
||||
btn:SetScript('OnClick', next_search)
|
||||
next_button = btn
|
||||
end
|
||||
@@ -99,7 +99,7 @@ do
|
||||
local label = gui.label(editbox, gui.font_size.medium)
|
||||
label:SetPoint('LEFT', editbox, 'RIGHT', 0, 0)
|
||||
label:SetTextColor(color.label.enabled())
|
||||
label:SetText'-'
|
||||
label:SetText('-')
|
||||
first_page_input = editbox
|
||||
end
|
||||
do
|
||||
@@ -125,7 +125,7 @@ do
|
||||
local btn = gui.button(frame)
|
||||
btn:SetHeight(25)
|
||||
btn:SetPoint('TOPRIGHT', -5, -8)
|
||||
btn:SetText'Search'
|
||||
btn:SetText('Search')
|
||||
btn:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
||||
btn:SetScript('OnClick', function()
|
||||
if arg1 == 'RightButton' then
|
||||
@@ -358,7 +358,7 @@ do
|
||||
end
|
||||
local label = gui.label(editbox, gui.font_size.medium)
|
||||
label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0)
|
||||
label:SetText'-'
|
||||
label:SetText('-')
|
||||
max_level_input = editbox
|
||||
end
|
||||
do
|
||||
@@ -488,7 +488,7 @@ do
|
||||
child:SetFont('p', [[Fonts\ARIALN.TTF]], bounded(11, 23, select(2, child:GetFont()) + arg1*2))
|
||||
update_filter_display()
|
||||
end)
|
||||
scroll_frame:RegisterForDrag'LeftButton'
|
||||
scroll_frame:RegisterForDrag('LeftButton')
|
||||
scroll_frame:SetScript('OnDragStart', function()
|
||||
this.x, this.y = GetCursorPosition()
|
||||
this.x_offset, this.y_offset = this:GetHorizontalScroll(), this:GetVerticalScroll()
|
||||
|
||||
+11
-11
@@ -86,7 +86,7 @@ do
|
||||
|
||||
search.status_bar = status_bars[getn(searches)]
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text''
|
||||
search.status_bar:set_text('')
|
||||
|
||||
search.table = tables[getn(searches)]
|
||||
search.table:SetSort(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
||||
@@ -159,7 +159,7 @@ function start_real_time_scan(query, search, continuation)
|
||||
auto_buy_validator = search.auto_buy_validator,
|
||||
on_scan_start = function()
|
||||
search.status_bar:update_status(99.99, 99.99)
|
||||
search.status_bar:set_text'Scanning last page ...'
|
||||
search.status_bar:set_text('Scanning last page ...')
|
||||
end,
|
||||
on_page_loaded = function(_, _, last_page)
|
||||
next_page = last_page
|
||||
@@ -184,7 +184,7 @@ function start_real_time_scan(query, search, continuation)
|
||||
new_records = values(map)
|
||||
|
||||
if getn(new_records) > 2000 then
|
||||
StaticPopup_Show'AUX_SEARCH_TABLE_FULL'
|
||||
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
|
||||
else
|
||||
search.records = new_records
|
||||
search.table:SetDatabase(search.records)
|
||||
@@ -196,7 +196,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
|
||||
|
||||
@@ -236,9 +236,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)
|
||||
@@ -260,13 +260,13 @@ function start_search(queries, continuation)
|
||||
if getn(search.records) < 2000 then
|
||||
tinsert(search.records, auction_record)
|
||||
if getn(search.records) == 2000 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
|
||||
subtab = SAVED
|
||||
@@ -277,7 +277,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 M.execute(resume, real_time)
|
||||
return
|
||||
elseif real_time then
|
||||
if getn(queries) > 1 then
|
||||
print'Error: The real time mode does not support multi-queries'
|
||||
print('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
|
||||
print'Error: The real time mode does not support page ranges'
|
||||
print('Error: The real time mode does not support page ranges')
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ function update_search_listings()
|
||||
for i, autobuy_filter in aux_auto_buy_filters do
|
||||
local name = strsub(autobuy_filter.prettified, 1, 250)
|
||||
tinsert(autobuy_filter_rows, {
|
||||
cols = {{ value=name }},
|
||||
cols = {{value=name}},
|
||||
search = autobuy_filter,
|
||||
index = i,
|
||||
})
|
||||
@@ -22,7 +22,7 @@ function update_search_listings()
|
||||
for i, favorite_search in aux_favorite_searches do
|
||||
local name = strsub(favorite_search.prettified, 1, 250)
|
||||
tinsert(favorite_search_rows, {
|
||||
cols = {{ value=name }},
|
||||
cols = {{value=name}},
|
||||
search = favorite_search,
|
||||
index = i,
|
||||
})
|
||||
@@ -33,7 +33,7 @@ function update_search_listings()
|
||||
for i, recent_search in aux_recent_searches do
|
||||
local name = strsub(recent_search.prettified, 1, 250)
|
||||
tinsert(recent_search_rows, {
|
||||
cols = {{ value=name }},
|
||||
cols = {{value=name}},
|
||||
search = recent_search,
|
||||
index = i,
|
||||
})
|
||||
@@ -136,9 +136,9 @@ function add_auto_buy(filter_string)
|
||||
local queries, error = filter_util.queries(filter_string)
|
||||
if queries then
|
||||
if getn(queries) > 1 then
|
||||
print'Error: The automatic buyout filter does not support multi-queries'
|
||||
print('Error: The automatic buyout filter does not support multi-queries')
|
||||
elseif size(queries[1].blizzard_query) > 0 and not filter_util.parse_filter_string(filter_string).blizzard.exact then
|
||||
print'Error: The automatic buyout filter does not support Blizzard filters'
|
||||
print('Error: The automatic buyout filter does not support Blizzard filters')
|
||||
else
|
||||
tinsert(aux_auto_buy_filters, 1, T(
|
||||
'filter_string', filter_string,
|
||||
|
||||
Reference in New Issue
Block a user