refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-24 10:29:27 +02:00
parent 25d59cd625
commit 2683e2591d
6 changed files with 37 additions and 37 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ RESULTS, SAVED, FILTER = 1, 2, 3
function LOAD()
create_frames()
set_tab(SAVED)
set_subtab(SAVED)
update_auto_buy_filter()
new_search ''
current_search.placeholder = true
@@ -78,7 +78,7 @@ function USE_ITEM(item_info)
execute(nil, false)
end
function set_tab(tab)
function set_subtab(tab)
search_results_button:UnlockHighlight()
saved_searches_button:UnlockHighlight()
+3 -3
View File
@@ -247,7 +247,7 @@ function create_frames()
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText 'Search Results'
btn:SetScript('OnClick', function() set_tab(RESULTS) end)
btn:SetScript('OnClick', function() set_subtab(RESULTS) end)
search_results_button = btn
end
do
@@ -256,7 +256,7 @@ function create_frames()
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText 'Saved Searches'
btn:SetScript('OnClick', function() set_tab(SAVED) end)
btn:SetScript('OnClick', function() set_subtab(SAVED) end)
saved_searches_button = btn
end
do
@@ -265,7 +265,7 @@ function create_frames()
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText 'Filter Builder'
btn:SetScript('OnClick', function() set_tab(FILTER) end)
btn:SetScript('OnClick', function() set_subtab(FILTER) end)
new_filter_button = btn
end
do
+4 -4
View File
@@ -66,13 +66,13 @@ do
function previous_search()
search_box:ClearFocus()
update_search(search_index - 1)
set_tab(RESULTS)
set_subtab(RESULTS)
end
function next_search()
search_box:ClearFocus()
update_search(search_index + 1)
set_tab(RESULTS)
set_subtab(RESULTS)
end
end
@@ -267,7 +267,7 @@ function start_search(queries, continuation)
search.status_bar:set_text 'Scan complete'
if current_search == search and frame.results:IsVisible() and getn(search.records) == 0 then
set_tab(SAVED)
set_subtab(SAVED)
end
search.active = false
@@ -348,7 +348,7 @@ function public.execute(resume, real_time)
current_search.active = true
update_start_stop()
set_tab(RESULTS)
set_subtab(RESULTS)
if real_time then
start_real_time_scan(queries[1], nil, continuation)
else