refactoring
This commit is contained in:
@@ -33,17 +33,16 @@ private.FILTER = 3
|
|||||||
function LOAD()
|
function LOAD()
|
||||||
aux_search_tab_frame.create()
|
aux_search_tab_frame.create()
|
||||||
subtab = SAVED
|
subtab = SAVED
|
||||||
current_search.placeholder = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function OPEN()
|
function OPEN()
|
||||||
frame:Show()
|
frame:Show()
|
||||||
update_search_listings()
|
aux_search_tab_saved.update_search_listings()
|
||||||
end
|
end
|
||||||
|
|
||||||
function CLOSE()
|
function CLOSE()
|
||||||
close_settings()
|
aux_search_tab_results.close_settings()
|
||||||
current_search.table:SetSelectedRecord()
|
aux_search_tab_results.current_search.table:SetSelectedRecord()
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -57,6 +56,10 @@ function USE_ITEM(item_info)
|
|||||||
execute(nil, false)
|
execute(nil, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function public.execute(resume, real_time)
|
||||||
|
aux_search_tab_results.execute(resume, real_time)
|
||||||
|
end
|
||||||
|
|
||||||
function private.subtab.set(tab)
|
function private.subtab.set(tab)
|
||||||
search_results_button:UnlockHighlight()
|
search_results_button:UnlockHighlight()
|
||||||
saved_searches_button:UnlockHighlight()
|
saved_searches_button:UnlockHighlight()
|
||||||
@@ -92,7 +95,7 @@ function public.add_filter(filter_string)
|
|||||||
search_box:SetText(old_filter_string .. filter_string)
|
search_box:SetText(old_filter_string .. filter_string)
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.blizzard_page_index(str)
|
function public.blizzard_page_index(str)
|
||||||
if tonumber(str) then
|
if tonumber(str) then
|
||||||
return max(0, tonumber(str) - 1)
|
return max(0, tonumber(str) - 1)
|
||||||
end
|
end
|
||||||
|
|||||||
+43
-43
@@ -52,7 +52,7 @@ function public.create()
|
|||||||
fake_icon_part:SetText('_')
|
fake_icon_part:SetText('_')
|
||||||
end
|
end
|
||||||
|
|
||||||
private.settings_button = btn
|
public.settings_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local panel = CreateFrame('Frame', nil, frame)
|
local panel = CreateFrame('Frame', nil, frame)
|
||||||
@@ -62,14 +62,14 @@ function public.create()
|
|||||||
panel:SetPoint('RIGHT', 0, 0)
|
panel:SetPoint('RIGHT', 0, 0)
|
||||||
panel:SetHeight(42)
|
panel:SetHeight(42)
|
||||||
panel:Hide()
|
panel:Hide()
|
||||||
private.settings = panel
|
public.settings = panel
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local panel = CreateFrame('Frame', nil, frame)
|
local panel = CreateFrame('Frame', nil, frame)
|
||||||
panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0)
|
panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0)
|
||||||
panel:SetPoint('RIGHT', 0, 1)
|
panel:SetPoint('RIGHT', 0, 1)
|
||||||
panel:SetHeight(40)
|
panel:SetHeight(40)
|
||||||
private.controls = panel
|
public.controls = panel
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local function change()
|
local function change()
|
||||||
@@ -96,7 +96,7 @@ function public.create()
|
|||||||
label:SetPoint('RIGHT', editbox, 'LEFT', -6, 0)
|
label:SetPoint('RIGHT', editbox, 'LEFT', -6, 0)
|
||||||
label:SetText('Pages')
|
label:SetText('Pages')
|
||||||
label:SetTextColor(color.text.enabled())
|
label:SetTextColor(color.text.enabled())
|
||||||
private.first_page_input = editbox
|
public.first_page_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(settings)
|
local editbox = gui.editbox(settings)
|
||||||
@@ -110,7 +110,7 @@ function public.create()
|
|||||||
label:SetPoint('RIGHT', editbox, 'LEFT', -3.5, 0)
|
label:SetPoint('RIGHT', editbox, 'LEFT', -3.5, 0)
|
||||||
label:SetText('-')
|
label:SetText('-')
|
||||||
label:SetTextColor(color.text.enabled())
|
label:SetTextColor(color.text.enabled())
|
||||||
private.last_page_input = editbox
|
public.last_page_input = editbox
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -141,7 +141,7 @@ function public.create()
|
|||||||
StaticPopup_Show('AUX_SEARCH_AUTO_BUY')
|
StaticPopup_Show('AUX_SEARCH_AUTO_BUY')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
private.auto_buy_button = btn
|
public.auto_buy_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.checkbutton(settings)
|
local btn = gui.checkbutton(settings)
|
||||||
@@ -169,7 +169,7 @@ function public.create()
|
|||||||
btn:SetScript('OnLeave', function()
|
btn:SetScript('OnLeave', function()
|
||||||
GameTooltip:Hide()
|
GameTooltip:Hide()
|
||||||
end)
|
end)
|
||||||
private.auto_buy_filter_button = btn
|
public.auto_buy_filter_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(controls, 25)
|
local btn = gui.button(controls, 25)
|
||||||
@@ -178,7 +178,7 @@ function public.create()
|
|||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetText('<')
|
btn:SetText('<')
|
||||||
btn:SetScript('OnClick', previous_search)
|
btn:SetScript('OnClick', previous_search)
|
||||||
private.previous_button = btn
|
public.previous_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(controls, 25)
|
local btn = gui.button(controls, 25)
|
||||||
@@ -187,7 +187,7 @@ function public.create()
|
|||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetText('>')
|
btn:SetText('>')
|
||||||
btn:SetScript('OnClick', next_search)
|
btn:SetScript('OnClick', next_search)
|
||||||
private.next_button = btn
|
public.next_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(controls, gui.font_size.huge)
|
local btn = gui.button(controls, gui.font_size.huge)
|
||||||
@@ -198,11 +198,11 @@ function public.create()
|
|||||||
btn:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
btn:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
if arg1 == 'RightButton' then
|
if arg1 == 'RightButton' then
|
||||||
set_filter(current_search.filter_string)
|
set_filter(aux_search_tab_results.current_search.filter_string)
|
||||||
end
|
end
|
||||||
execute()
|
execute()
|
||||||
end)
|
end)
|
||||||
private.start_button = btn
|
public.start_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(controls, gui.font_size.huge)
|
local btn = gui.button(controls, gui.font_size.huge)
|
||||||
@@ -213,7 +213,7 @@ function public.create()
|
|||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
aux_scan.abort(aux_search_tab_results.search_scan_id)
|
aux_scan.abort(aux_search_tab_results.search_scan_id)
|
||||||
end)
|
end)
|
||||||
private.stop_button = btn
|
public.stop_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(controls, gui.font_size.huge)
|
local btn = gui.button(controls, gui.font_size.huge)
|
||||||
@@ -224,7 +224,7 @@ function public.create()
|
|||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
execute(true)
|
execute(true)
|
||||||
end)
|
end)
|
||||||
private.resume_button = btn
|
public.resume_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(controls)
|
local editbox = gui.editbox(controls)
|
||||||
@@ -243,7 +243,7 @@ function public.create()
|
|||||||
this:HighlightText(0, 0)
|
this:HighlightText(0, 0)
|
||||||
end)
|
end)
|
||||||
editbox.enter = execute
|
editbox.enter = execute
|
||||||
private.search_box = editbox
|
public.search_box = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
gui.horizontal_line(frame, -40)
|
gui.horizontal_line(frame, -40)
|
||||||
@@ -255,7 +255,7 @@ function public.create()
|
|||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText('Search Results')
|
btn:SetText('Search Results')
|
||||||
btn:SetScript('OnClick', function() subtab = RESULTS end)
|
btn:SetScript('OnClick', function() subtab = RESULTS end)
|
||||||
private.search_results_button = btn
|
public.search_results_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, gui.font_size.large)
|
local btn = gui.button(frame, gui.font_size.large)
|
||||||
@@ -264,7 +264,7 @@ function public.create()
|
|||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText('Saved Searches')
|
btn:SetText('Saved Searches')
|
||||||
btn:SetScript('OnClick', function() subtab = SAVED end)
|
btn:SetScript('OnClick', function() subtab = SAVED end)
|
||||||
private.saved_searches_button = btn
|
public.saved_searches_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, gui.font_size.large)
|
local btn = gui.button(frame, gui.font_size.large)
|
||||||
@@ -273,36 +273,36 @@ function public.create()
|
|||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText('Filter Builder')
|
btn:SetText('Filter Builder')
|
||||||
btn:SetScript('OnClick', function() subtab = FILTER end)
|
btn:SetScript('OnClick', function() subtab = FILTER end)
|
||||||
private.new_filter_button = btn
|
public.new_filter_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local frame = CreateFrame('Frame', nil, frame)
|
local frame = CreateFrame('Frame', nil, frame)
|
||||||
frame:SetWidth(265)
|
frame:SetWidth(265)
|
||||||
frame:SetHeight(25)
|
frame:SetHeight(25)
|
||||||
frame:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
|
frame:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
|
||||||
private.status_bar_frame = frame
|
public.status_bar_frame = frame
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.results)
|
local btn = gui.button(frame.results)
|
||||||
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Bid')
|
btn:SetText('Bid')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
private.bid_button = btn
|
public.bid_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.results)
|
local btn = gui.button(frame.results)
|
||||||
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Buyout')
|
btn:SetText('Buyout')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
private.buyout_button = btn
|
public.buyout_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.results)
|
local btn = gui.button(frame.results)
|
||||||
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Clear')
|
btn:SetText('Clear')
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
while tremove(current_search.records) do end
|
while tremove(aux_search_tab_results.current_search.records) do end
|
||||||
current_search.table:SetDatabase()
|
aux_search_tab_results.current_search.table:SetDatabase()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -319,7 +319,7 @@ function public.create()
|
|||||||
else
|
else
|
||||||
print('Invalid filter:', error)
|
print('Invalid filter:', error)
|
||||||
end
|
end
|
||||||
update_search_listings()
|
aux_search_tab_saved.update_search_listings()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -366,7 +366,7 @@ function public.create()
|
|||||||
local label = gui.label(editbox, gui.font_size.small)
|
local label = gui.label(editbox, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText('Name')
|
label:SetText('Name')
|
||||||
private.name_input = editbox
|
public.name_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local checkbox = gui.checkbox(frame.filter)
|
local checkbox = gui.checkbox(frame.filter)
|
||||||
@@ -375,7 +375,7 @@ function public.create()
|
|||||||
local label = gui.label(checkbox, gui.font_size.small)
|
local label = gui.label(checkbox, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText('Exact')
|
label:SetText('Exact')
|
||||||
private.exact_checkbox = checkbox
|
public.exact_checkbox = checkbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(frame.filter)
|
local editbox = gui.editbox(frame.filter)
|
||||||
@@ -400,7 +400,7 @@ function public.create()
|
|||||||
local label = gui.label(editbox, gui.font_size.small)
|
local label = gui.label(editbox, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText('Level Range')
|
label:SetText('Level Range')
|
||||||
private.min_level_input = editbox
|
public.min_level_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(frame.filter)
|
local editbox = gui.editbox(frame.filter)
|
||||||
@@ -425,7 +425,7 @@ function public.create()
|
|||||||
local label = gui.label(editbox, gui.font_size.medium)
|
local label = gui.label(editbox, gui.font_size.medium)
|
||||||
label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0)
|
label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0)
|
||||||
label:SetText('-')
|
label:SetText('-')
|
||||||
private.max_level_input = editbox
|
public.max_level_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local checkbox = gui.checkbox(frame.filter)
|
local checkbox = gui.checkbox(frame.filter)
|
||||||
@@ -434,11 +434,11 @@ function public.create()
|
|||||||
local label = gui.label(checkbox, gui.font_size.small)
|
local label = gui.label(checkbox, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText('Usable')
|
label:SetText('Usable')
|
||||||
private.usable_checkbox = checkbox
|
public.usable_checkbox = checkbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
private.class_dropdown = dropdown
|
public.class_dropdown = dropdown
|
||||||
dropdown:SetPoint('TOPLEFT', min_level_input, 'BOTTOMLEFT', 0, 5 - FILTER_SPACING)
|
dropdown:SetPoint('TOPLEFT', min_level_input, 'BOTTOMLEFT', 0, 5 - FILTER_SPACING)
|
||||||
dropdown:SetWidth(300)
|
dropdown:SetWidth(300)
|
||||||
local label = gui.label(dropdown, gui.font_size.small)
|
local label = gui.label(dropdown, gui.font_size.small)
|
||||||
@@ -451,7 +451,7 @@ function public.create()
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
private.subclass_dropdown = dropdown
|
public.subclass_dropdown = dropdown
|
||||||
dropdown:SetPoint('TOPLEFT', class_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
dropdown:SetPoint('TOPLEFT', class_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
||||||
dropdown:SetWidth(300)
|
dropdown:SetWidth(300)
|
||||||
local label = gui.label(dropdown, gui.font_size.small)
|
local label = gui.label(dropdown, gui.font_size.small)
|
||||||
@@ -464,7 +464,7 @@ function public.create()
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
private.slot_dropdown = dropdown
|
public.slot_dropdown = dropdown
|
||||||
dropdown:SetPoint('TOPLEFT', subclass_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
dropdown:SetPoint('TOPLEFT', subclass_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
||||||
dropdown:SetWidth(300)
|
dropdown:SetWidth(300)
|
||||||
local label = gui.label(dropdown, gui.font_size.small)
|
local label = gui.label(dropdown, gui.font_size.small)
|
||||||
@@ -477,7 +477,7 @@ function public.create()
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
private.quality_dropdown = dropdown
|
public.quality_dropdown = dropdown
|
||||||
dropdown:SetPoint('TOPLEFT', slot_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
dropdown:SetPoint('TOPLEFT', slot_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
||||||
dropdown:SetWidth(300)
|
dropdown:SetWidth(300)
|
||||||
local label = gui.label(dropdown, gui.font_size.small)
|
local label = gui.label(dropdown, gui.font_size.small)
|
||||||
@@ -501,7 +501,7 @@ function public.create()
|
|||||||
local label = gui.label(dropdown, gui.font_size.medium)
|
local label = gui.label(dropdown, gui.font_size.medium)
|
||||||
label:SetPoint('RIGHT', dropdown, 'LEFT', -15, 0)
|
label:SetPoint('RIGHT', dropdown, 'LEFT', -15, 0)
|
||||||
label:SetText('Post Filter')
|
label:SetText('Post Filter')
|
||||||
private.filter_dropdown = dropdown
|
public.filter_dropdown = dropdown
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local input = gui.editbox(frame.filter)
|
local input = gui.editbox(frame.filter)
|
||||||
@@ -528,7 +528,7 @@ function public.create()
|
|||||||
add_post_filter()
|
add_post_filter()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
private.filter_input = input
|
public.filter_input = input
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local input = gui.editbox(frame.filter)
|
local input = gui.editbox(frame.filter)
|
||||||
@@ -540,7 +540,7 @@ function public.create()
|
|||||||
input.char = function() this:complete() end
|
input.char = function() this:complete() end
|
||||||
input.enter = add_post_filter
|
input.enter = add_post_filter
|
||||||
input:Hide()
|
input:Hide()
|
||||||
private.filter_parameter_input = input
|
public.filter_parameter_input = input
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local scroll_frame = CreateFrame('ScrollFrame', nil, frame.filter)
|
local scroll_frame = CreateFrame('ScrollFrame', nil, frame.filter)
|
||||||
@@ -583,7 +583,7 @@ function public.create()
|
|||||||
scroll_child:SetScript('OnHyperlinkClick', data_link_click)
|
scroll_child:SetScript('OnHyperlinkClick', data_link_click)
|
||||||
-- scroll_child:SetHyperlinkFormat("format") TODO
|
-- scroll_child:SetHyperlinkFormat("format") TODO
|
||||||
scroll_child.measure = scroll_child:CreateFontString()
|
scroll_child.measure = scroll_child:CreateFontString()
|
||||||
private.filter_display = scroll_child
|
public.filter_display = scroll_child
|
||||||
end
|
end
|
||||||
|
|
||||||
public.status_bars = t
|
public.status_bars = t
|
||||||
@@ -596,7 +596,7 @@ function public.create()
|
|||||||
|
|
||||||
local table = auction_listing.CreateAuctionResultsTable(frame.results, auction_listing.search_config)
|
local table = auction_listing.CreateAuctionResultsTable(frame.results, auction_listing.search_config)
|
||||||
table:SetHandler('OnCellClick', function(cell, button)
|
table:SetHandler('OnCellClick', function(cell, button)
|
||||||
if IsAltKeyDown() and current_search.table:GetSelection().record == cell.row.data.record then
|
if IsAltKeyDown() and aux_search_tab_results.current_search.table:GetSelection().record == cell.row.data.record then
|
||||||
if button == 'LeftButton' and buyout_button:IsEnabled() then
|
if button == 'LeftButton' and buyout_button:IsEnabled() then
|
||||||
buyout_button:Click()
|
buyout_button:Click()
|
||||||
elseif button == 'RightButton' and bid_button:IsEnabled() then
|
elseif button == 'RightButton' and bid_button:IsEnabled() then
|
||||||
@@ -606,7 +606,7 @@ function public.create()
|
|||||||
end)
|
end)
|
||||||
table:SetHandler('OnSelectionChanged', function(rt, datum)
|
table:SetHandler('OnSelectionChanged', function(rt, datum)
|
||||||
if not datum then return end
|
if not datum then return end
|
||||||
find_auction(datum.record)
|
aux_search_tab_results.find_auction(datum.record)
|
||||||
end)
|
end)
|
||||||
table:Hide()
|
table:Hide()
|
||||||
tinsert(tables, table)
|
tinsert(tables, table)
|
||||||
@@ -624,14 +624,14 @@ function public.create()
|
|||||||
local temp = aux_favorite_searches[data.index - 1]
|
local temp = aux_favorite_searches[data.index - 1]
|
||||||
aux_favorite_searches[data.index - 1] = data.search
|
aux_favorite_searches[data.index - 1] = data.search
|
||||||
aux_favorite_searches[data.index] = temp
|
aux_favorite_searches[data.index] = temp
|
||||||
update_search_listings()
|
aux_search_tab_saved.update_search_listings()
|
||||||
end
|
end
|
||||||
elseif button == 'RightButton' and IsControlKeyDown() then
|
elseif button == 'RightButton' and IsControlKeyDown() then
|
||||||
if st == favorite_searches_listing and data.index < getn(aux_favorite_searches) then
|
if st == favorite_searches_listing and data.index < getn(aux_favorite_searches) then
|
||||||
local temp = aux_favorite_searches[data.index + 1]
|
local temp = aux_favorite_searches[data.index + 1]
|
||||||
aux_favorite_searches[data.index + 1] = data.search
|
aux_favorite_searches[data.index + 1] = data.search
|
||||||
aux_favorite_searches[data.index] = temp
|
aux_favorite_searches[data.index] = temp
|
||||||
update_search_listings()
|
aux_search_tab_saved.update_search_listings()
|
||||||
end
|
end
|
||||||
elseif button == 'LeftButton' then
|
elseif button == 'LeftButton' then
|
||||||
search_box:SetText(data.search.filter_string)
|
search_box:SetText(data.search.filter_string)
|
||||||
@@ -642,7 +642,7 @@ function public.create()
|
|||||||
elseif st == favorite_searches_listing then
|
elseif st == favorite_searches_listing then
|
||||||
tremove(aux_favorite_searches, data.index)
|
tremove(aux_favorite_searches, data.index)
|
||||||
end
|
end
|
||||||
update_search_listings()
|
aux_search_tab_saved.update_search_listings()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
OnEnter = function(st, data, self)
|
OnEnter = function(st, data, self)
|
||||||
@@ -657,7 +657,7 @@ function public.create()
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
private.recent_searches_listing = listing.CreateScrollingTable(frame.saved.recent)
|
public.recent_searches_listing = listing.CreateScrollingTable(frame.saved.recent)
|
||||||
recent_searches_listing:SetColInfo{{ name='Recent Searches', width=1 }}
|
recent_searches_listing:SetColInfo{{ name='Recent Searches', width=1 }}
|
||||||
recent_searches_listing:EnableSorting(false)
|
recent_searches_listing:EnableSorting(false)
|
||||||
recent_searches_listing:DisableSelection(true)
|
recent_searches_listing:DisableSelection(true)
|
||||||
@@ -665,7 +665,7 @@ function public.create()
|
|||||||
recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
|
recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
|
||||||
recent_searches_listing:SetHandler('OnLeave', handlers.OnLeave)
|
recent_searches_listing:SetHandler('OnLeave', handlers.OnLeave)
|
||||||
|
|
||||||
private.favorite_searches_listing = listing.CreateScrollingTable(frame.saved.favorite)
|
public.favorite_searches_listing = listing.CreateScrollingTable(frame.saved.favorite)
|
||||||
favorite_searches_listing:SetColInfo{{ name='Favorite Searches', width=1 }}
|
favorite_searches_listing:SetColInfo{{ name='Favorite Searches', width=1 }}
|
||||||
favorite_searches_listing:EnableSorting(false)
|
favorite_searches_listing:EnableSorting(false)
|
||||||
favorite_searches_listing:DisableSelection(true)
|
favorite_searches_listing:DisableSelection(true)
|
||||||
|
|||||||
+12
-9
@@ -8,8 +8,9 @@ include (aux_util_color)
|
|||||||
|
|
||||||
function LOAD()
|
function LOAD()
|
||||||
include (aux_search_tab)
|
include (aux_search_tab)
|
||||||
update_auto_buy_filter()
|
|
||||||
new_search('')
|
new_search('')
|
||||||
|
current_search.dummy = true
|
||||||
|
update_auto_buy_filter()
|
||||||
end
|
end
|
||||||
|
|
||||||
local info, scan = aux_info, aux_scan
|
local info, scan = aux_info, aux_scan
|
||||||
@@ -61,7 +62,9 @@ do
|
|||||||
local searches = t
|
local searches = t
|
||||||
local search_index = 1
|
local search_index = 1
|
||||||
|
|
||||||
function private.current_search.get() return searches[search_index] end
|
function public.current_search.get()
|
||||||
|
return searches[search_index]
|
||||||
|
end
|
||||||
|
|
||||||
function private.update_search(index)
|
function private.update_search(index)
|
||||||
searches[search_index].status_bar:Hide()
|
searches[search_index].status_bar:Hide()
|
||||||
@@ -128,7 +131,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.close_settings()
|
function public.close_settings()
|
||||||
if settings_button.open then
|
if settings_button.open then
|
||||||
settings_button:Click()
|
settings_button:Click()
|
||||||
end
|
end
|
||||||
@@ -362,10 +365,10 @@ function public.execute(resume, real_time)
|
|||||||
return
|
return
|
||||||
elseif real_time then
|
elseif real_time then
|
||||||
if getn(queries) > 1 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
|
return
|
||||||
elseif queries[1].blizzard_query.first_page or queries[1].blizzard_query.last_page then
|
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
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -375,10 +378,10 @@ function public.execute(resume, real_time)
|
|||||||
if resume then
|
if resume then
|
||||||
current_search.table:SetSelectedRecord()
|
current_search.table:SetSelectedRecord()
|
||||||
else
|
else
|
||||||
if filter_string ~= current_search.filter_string or current_search.placeholder then
|
if filter_string ~= current_search.filter_string or current_search.dummy then
|
||||||
if current_search.placeholder then
|
if current_search.dummy then
|
||||||
current_search.filter_string = filter_string
|
current_search.filter_string = filter_string
|
||||||
current_search.placeholder = false
|
current_search.dummy = false
|
||||||
else
|
else
|
||||||
new_search(filter_string)
|
new_search(filter_string)
|
||||||
end
|
end
|
||||||
@@ -425,7 +428,7 @@ do
|
|||||||
local state = IDLE
|
local state = IDLE
|
||||||
local found_index
|
local found_index
|
||||||
|
|
||||||
function private.find_auction(record)
|
function public.find_auction(record)
|
||||||
local search = current_search
|
local search = current_search
|
||||||
|
|
||||||
if not search.table:ContainsRecord(record) or is_player(record.owner) then
|
if not search.table:ContainsRecord(record) or is_player(record.owner) then
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ end
|
|||||||
aux_favorite_searches = t
|
aux_favorite_searches = t
|
||||||
aux_recent_searches = t
|
aux_recent_searches = t
|
||||||
|
|
||||||
function private.update_search_listings()
|
function public.update_search_listings()
|
||||||
local favorite_search_rows = t
|
local favorite_search_rows = t
|
||||||
for i, favorite_search in aux_favorite_searches do
|
for i, favorite_search in aux_favorite_searches do
|
||||||
local name = strsub(favorite_search.prettified, 1, 250)
|
local name = strsub(favorite_search.prettified, 1, 250)
|
||||||
|
|||||||
Reference in New Issue
Block a user