module refactoring

This commit is contained in:
Simon Hirsig
2017-11-01 15:01:41 +01:00
parent 9989ceb42f
commit 8823b34904
36 changed files with 669 additions and 646 deletions
+15 -14
View File
@@ -1,11 +1,12 @@
module 'aux.tabs.search'
include 'T'
include 'aux'
local T = require 'T'
local info = require 'aux.util.info'
TAB 'Search'
local tab = 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.',
@@ -19,32 +20,32 @@ RESULTS = 1
SAVED = 2
FILTER = 3
function LOAD()
subtab = SAVED
function handle.LOAD()
set_subtab(SAVED)
end
function OPEN()
function tab.OPEN()
frame:Show()
update_search_listings()
update_filter_display()
end
function CLOSE()
current_search.table:SetSelectedRecord()
function tab.CLOSE()
get_current_search().table:SetSelectedRecord()
frame:Hide()
end
function CLICK_LINK(item_info)
filter = strlower(item_info.name) .. '/exact'
function tab.CLICK_LINK(item_info)
set_filter(strlower(item_info.name) .. '/exact')
execute(nil, false)
end
function USE_ITEM(item_info)
filter = strlower(info.item(item_info.item_id).name) .. '/exact'
function tab.USE_ITEM(item_info)
set_filter(strlower(info.item(item_info.item_id).name) .. '/exact')
execute(nil, false)
end
function set.subtab(tab)
function set_subtab(tab)
CloseDropDownMenus()
search_results_button:UnlockHighlight()
saved_searches_button:UnlockHighlight()
@@ -65,7 +66,7 @@ function set.subtab(tab)
end
end
function M.set.filter(filter_string)
function M.set_filter(filter_string)
search_box:SetFocus()
search_box:SetText(filter_string)
end
@@ -78,7 +79,7 @@ function add_filter(filter_string)
old_filter_string = old_filter_string .. ';'
end
filter = old_filter_string .. filter_string
set_filter(old_filter_string .. filter_string)
end
function blizzard_page_index(str)