refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-28 03:00:16 +02:00
parent f42e54a4fc
commit c07c3dad6f
16 changed files with 92 additions and 92 deletions
+3 -3
View File
@@ -446,7 +446,7 @@ function refresh_entries()
existing_auctions[item_key] = nil
local query = scan_util.item_query(item_id)
status_bar:update_status(0,0)
status_bar:set_text 'Scanning auctions...'
status_bar:set_text('Scanning auctions...')
scan_id = scan.start{
type = 'list',
@@ -472,13 +472,13 @@ function refresh_entries()
existing_auctions[item_key] = nil
update_historical_value_button()
status_bar:update_status(100, 100)
status_bar:set_text 'Scan aborted'
status_bar:set_text('Scan aborted')
end,
on_complete = function()
existing_auctions[item_key] = existing_auctions[item_key] or t
refresh = true
status_bar:update_status(100, 100)
status_bar:set_text 'Scan complete'
status_bar:set_text('Scan complete')
end,
}
end
+17 -17
View File
@@ -34,7 +34,7 @@ function create_frames()
end)
local label = gui.label(checkbox, gui.font_size.small)
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
label:SetText 'Show hidden items'
label:SetText('Show hidden items')
show_hidden_checkbox = checkbox
end
@@ -86,14 +86,14 @@ function create_frames()
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(100, 100)
status_bar:set_text ''
status_bar:set_text('')
end
do
local btn = gui.button(frame.parameters, 16)
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText 'Post'
btn:SetText('Post')
btn:SetScript('OnClick', post_auctions)
post_button = btn
end
@@ -102,7 +102,7 @@ function create_frames()
btn:SetPoint('TOPLEFT', post_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText 'Refresh'
btn:SetText('Refresh')
btn:SetScript('OnClick', function()
scan.abort(scan_id)
refresh_entries()
@@ -150,7 +150,7 @@ function create_frames()
end)
slider.editbox:SetNumeric(true)
slider.editbox:SetMaxLetters(3)
slider.label:SetText 'Stack Size'
slider.label:SetText('Stack Size')
stack_size_slider = slider
end
do
@@ -173,7 +173,7 @@ function create_frames()
end
end)
slider.editbox:SetNumeric(true)
slider.label:SetText 'Stack Count'
slider.label:SetText('Stack Count')
stack_count_slider = slider
end
do
@@ -205,7 +205,7 @@ function create_frames()
end)
local label = gui.label(checkbox, gui.font_size.small)
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
label:SetText 'Hide this item'
label:SetText('Hide this item')
hide_checkbox = checkbox
end
local function money_input()
@@ -221,7 +221,7 @@ function create_frames()
frame:SetHeight(22)
local editbox = gui.editbox(frame)
editbox:SetAllPoints()
editbox:SetAlignment 'RIGHT'
editbox:SetAlignment('RIGHT')
editbox:SetFontSize(17)
editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() and stack_count_slider.editbox:IsVisible() then
@@ -250,18 +250,18 @@ function create_frames()
editbox.pretty = gui.label(frame, 17)
editbox.pretty:SetPoint('LEFT', 1, 0)
editbox.pretty:SetPoint('RIGHT', -2, 0)
editbox.pretty:SetJustifyH 'RIGHT'
editbox.pretty:SetJustifyH('RIGHT')
editbox.pretty:SetTextColor(color.text.enabled())
do
local label = gui.label(frame, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1)
label:SetText 'Unit Starting Price'
label:SetText('Unit Starting Price')
end
do
local label = gui.label(frame, 14)
label:SetPoint('LEFT', frame, 'RIGHT', 8, 0)
label:SetWidth(50)
label:SetJustifyH 'CENTER'
label:SetJustifyH('CENTER')
start_price_percentage = label
end
unit_start_price = editbox
@@ -275,7 +275,7 @@ function create_frames()
frame:SetHeight(22)
local editbox = gui.editbox(frame)
editbox:SetAllPoints()
editbox:SetAlignment 'RIGHT'
editbox:SetAlignment('RIGHT')
editbox:SetFontSize(17)
editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
@@ -302,18 +302,18 @@ function create_frames()
editbox.pretty = gui.label(frame, 17)
editbox.pretty:SetPoint('LEFT', 1, 0)
editbox.pretty:SetPoint('RIGHT', -2, 0)
editbox.pretty:SetJustifyH 'RIGHT'
editbox.pretty:SetJustifyH('RIGHT')
editbox.pretty:SetTextColor(color.text.enabled())
do
local label = gui.label(frame, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1)
label:SetText 'Unit Buyout Price'
label:SetText('Unit Buyout Price')
end
do
local label = gui.label(frame, 14)
label:SetPoint('LEFT', frame, 'RIGHT', 8, 0)
label:SetWidth(50)
label:SetJustifyH 'CENTER'
label:SetJustifyH('CENTER')
buyout_price_percentage = label
end
unit_buyout_price = editbox
@@ -322,7 +322,7 @@ function create_frames()
local btn = gui.button(frame.parameters, 14)
btn:SetPoint('TOPRIGHT', -10, -146)
gui.set_size(btn, 150, 20)
btn:GetFontString():SetJustifyH 'RIGHT'
btn:GetFontString():SetJustifyH('RIGHT')
btn:GetFontString():SetPoint('RIGHT', -2, 0)
btn:SetScript('OnClick', function()
if this.amount then
@@ -332,7 +332,7 @@ function create_frames()
end)
local label = gui.label(btn, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', btn, 'TOPLEFT', -2, 1)
label:SetText 'Historical Value'
label:SetText('Historical Value')
historical_value_button = btn
end
end
+1 -1
View File
@@ -53,7 +53,7 @@ function LOAD()
create_frames()
subtab = SAVED
update_auto_buy_filter()
new_search ''
new_search('')
current_search.placeholder = true
end
+2 -2
View File
@@ -193,7 +193,7 @@ function public.formatted_post_filter(components)
elseif i > 1 then
str = str..'</p><p>'
for _=1,getn(stack) do
str = str..color.content.background '----'
str = str..color.content.background('----')
end
end
no_line_break = component[1] == 'operator' and component[2] == 'not'
@@ -269,7 +269,7 @@ function add_post_filter()
if components and getn(components.blizzard) == 0 and getn(components.post) == 1 then
add_component(components.post[1])
update_filter_display()
filter_parameter_input:SetText ''
filter_parameter_input:SetText('')
filter_input:HighlightText()
filter_input:SetFocus()
elseif error then
+12 -12
View File
@@ -246,7 +246,7 @@ function create_frames()
btn:SetPoint('BOTTOMLEFT', aux_frame.content, 'TOPLEFT', 10, 8)
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText 'Search Results'
btn:SetText('Search Results')
btn:SetScript('OnClick', function() subtab = RESULTS end)
search_results_button = btn
end
@@ -255,7 +255,7 @@ function create_frames()
btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText 'Saved Searches'
btn:SetText('Saved Searches')
btn:SetScript('OnClick', function() subtab = SAVED end)
saved_searches_button = btn
end
@@ -264,7 +264,7 @@ function create_frames()
btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText 'Filter Builder'
btn:SetText('Filter Builder')
btn:SetScript('OnClick', function() subtab = FILTER end)
new_filter_button = btn
end
@@ -280,7 +280,7 @@ function create_frames()
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText 'Bid'
btn:SetText('Bid')
btn:Disable()
bid_button = btn
end
@@ -289,7 +289,7 @@ function create_frames()
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText 'Buyout'
btn:SetText('Buyout')
btn:Disable()
buyout_button = btn
end
@@ -298,7 +298,7 @@ function create_frames()
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText 'Clear'
btn:SetText('Clear')
btn:SetScript('OnClick', function()
while tremove(current_search.records) do end
current_search.table:SetDatabase()
@@ -309,7 +309,7 @@ function create_frames()
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText 'Favorite'
btn:SetText('Favorite')
btn:SetScript('OnClick', function()
local filters = filter_util.queries(search_box:GetText())
if filters then
@@ -325,7 +325,7 @@ function create_frames()
local btn1 = gui.button(frame.filter, 16)
btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
gui.set_size(btn1, 80, 24)
btn1:SetText 'Search'
btn1:SetText('Search')
btn1:SetScript('OnClick', function()
export_query_string()
execute()
@@ -334,13 +334,13 @@ function create_frames()
local btn2 = gui.button(frame.filter, 16)
btn2:SetPoint('LEFT', btn1, 'RIGHT', 5, 0)
gui.set_size(btn2, 80, 24)
btn2:SetText 'Export'
btn2:SetText('Export')
btn2:SetScript('OnClick', export_query_string)
local btn3 = gui.button(frame.filter, 16)
btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0)
gui.set_size(btn3, 80, 24)
btn3:SetText 'Import'
btn3:SetText('Import')
btn3:SetScript('OnClick', import_query_string)
end
do
@@ -367,7 +367,7 @@ function create_frames()
editbox.enter = L(editbox.ClearFocus, editbox)
local label = gui.label(editbox, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
label:SetText 'Name'
label:SetText('Name')
name_input = editbox
end
do
@@ -401,7 +401,7 @@ function create_frames()
end
local label = gui.label(editbox, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
label:SetText 'Level Range'
label:SetText('Level Range')
min_level_input = editbox
end
do
+8 -8
View File
@@ -67,7 +67,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)
@@ -192,7 +192,7 @@ function start_real_time_scan(query, search, continuation)
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)
@@ -204,7 +204,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
@@ -244,9 +244,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)
@@ -272,13 +272,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
subtab = SAVED
@@ -289,7 +289,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}