search config design improvements
This commit is contained in:
@@ -359,7 +359,7 @@ function private.SetItemRef(...)
|
|||||||
local item_info = m.info.item(tonumber(({strfind(itemstring, '^item:(%d+)')})[3]))
|
local item_info = m.info.item(tonumber(({strfind(itemstring, '^item:(%d+)')})[3]))
|
||||||
if item_info then
|
if item_info then
|
||||||
m.search_tab.set_filter(strlower(item_info.name)..'/exact')
|
m.search_tab.set_filter(strlower(item_info.name)..'/exact')
|
||||||
if m.real_time_button.on then
|
if m.real_time_button:GetChecked() then
|
||||||
m.real_time_button:Click()
|
m.real_time_button:Click()
|
||||||
end
|
end
|
||||||
m.search_tab.execute()
|
m.search_tab.execute()
|
||||||
@@ -380,7 +380,7 @@ function private.UseContainerItem(...)
|
|||||||
item_info = item_info and m.info.item(item_info.item_id)
|
item_info = item_info and m.info.item(item_info.item_id)
|
||||||
if item_info then
|
if item_info then
|
||||||
m.search_tab.set_filter(strlower(item_info.name)..'/exact')
|
m.search_tab.set_filter(strlower(item_info.name)..'/exact')
|
||||||
if m.real_time_button.on then
|
if m.real_time_button:GetChecked() then
|
||||||
m.real_time_button:Click()
|
m.real_time_button:Click()
|
||||||
end
|
end
|
||||||
m.search_tab.execute()
|
m.search_tab.execute()
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</Layers>
|
</Layers>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
<Frame name="AuxFrame" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent" clampedToScreen="true">
|
<Frame name="AuxFrame" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent">
|
||||||
<Size><AbsDimension x="768" y="447"/></Size>
|
<Size><AbsDimension x="768" y="447"/></Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="LEFT">
|
<Anchor point="LEFT">
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ public.config = {
|
|||||||
normal_button_font_size = 16, -- 15 not working for some clients
|
normal_button_font_size = 16, -- 15 not working for some clients
|
||||||
text_color = { enabled = { 255/255, 254/255, 250/255, 1 }, disabled = { 147/255, 151/255, 139/255, 1 } },
|
text_color = { enabled = { 255/255, 254/255, 250/255, 1 }, disabled = { 147/255, 151/255, 139/255, 1 } },
|
||||||
label_color = { enabled = { 216/255, 225/255, 211/255, 1 }, disabled = { 150/255, 148/255, 140/255, 1 } },
|
label_color = { enabled = { 216/255, 225/255, 211/255, 1 }, disabled = { 150/255, 148/255, 140/255, 1 } },
|
||||||
|
on_color = {0.3, 0.7, 0.3},
|
||||||
|
off_color = {0.7, 0.3, 0.3 },
|
||||||
}
|
}
|
||||||
|
|
||||||
function public.inline_color(color)
|
function public.inline_color(color)
|
||||||
@@ -56,14 +57,33 @@ end
|
|||||||
|
|
||||||
function public.panel(parent)
|
function public.panel(parent)
|
||||||
local panel = CreateFrame('Frame', nil, parent)
|
local panel = CreateFrame('Frame', nil, parent)
|
||||||
panel:SetBackdrop{bgFile='Interface\\Buttons\\WHITE8X8'}
|
panel:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]]}
|
||||||
panel:SetBackdropColor(unpack(m.config.content_color))
|
panel:SetBackdropColor(unpack(m.config.content_color))
|
||||||
return panel
|
return panel
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.button(parent, text_height, name)
|
function public.checkbutton(parent, text_height)
|
||||||
local button = CreateFrame('Button', name, parent)
|
local button = m.button(parent, text_height)
|
||||||
button:SetBackdrop{bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=m.config.edge_size}
|
button.state = false
|
||||||
|
button:SetBackdropColor(unpack(m.config.off_color))
|
||||||
|
function button:SetChecked(state)
|
||||||
|
if state then
|
||||||
|
self:SetBackdropColor(unpack(m.config.on_color))
|
||||||
|
self.state = true
|
||||||
|
else
|
||||||
|
self:SetBackdropColor(unpack(m.config.off_color))
|
||||||
|
self.state = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function button:GetChecked()
|
||||||
|
return self.state
|
||||||
|
end
|
||||||
|
return button
|
||||||
|
end
|
||||||
|
|
||||||
|
function public.button(parent, text_height)
|
||||||
|
local button = CreateFrame('Button', nil, parent)
|
||||||
|
button:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=m.config.edge_size}
|
||||||
button:SetBackdropColor(unpack(m.config.content_color))
|
button:SetBackdropColor(unpack(m.config.content_color))
|
||||||
button:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
button:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
||||||
local highlight = button:CreateTexture(nil, 'HIGHLIGHT')
|
local highlight = button:CreateTexture(nil, 'HIGHLIGHT')
|
||||||
@@ -127,7 +147,7 @@ do
|
|||||||
tab.id = id
|
tab.id = id
|
||||||
tab.group = self
|
tab.group = self
|
||||||
tab:SetHeight(24)
|
tab:SetHeight(24)
|
||||||
tab:SetBackdrop{bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=m.config.edge_size}
|
tab:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=m.config.edge_size}
|
||||||
tab:SetBackdropColor(0, 0, 0, 0)
|
tab:SetBackdropColor(0, 0, 0, 0)
|
||||||
tab:SetBackdropBorderColor(unpack(m.config.frame_border_color))
|
tab:SetBackdropBorderColor(unpack(m.config.frame_border_color))
|
||||||
local image = tab:CreateTexture(nil, 'BACKGROUND')
|
local image = tab:CreateTexture(nil, 'BACKGROUND')
|
||||||
@@ -230,7 +250,7 @@ function public.editbox(parent, name)
|
|||||||
editbox:SetHeight(19)
|
editbox:SetHeight(19)
|
||||||
editbox:SetFont(m.config.content_font, m.config.normal_font_size)
|
editbox:SetFont(m.config.content_font, m.config.normal_font_size)
|
||||||
editbox:SetShadowColor(0, 0, 0, 0)
|
editbox:SetShadowColor(0, 0, 0, 0)
|
||||||
editbox:SetBackdrop{bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=m.config.edge_size}
|
editbox:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=m.config.edge_size}
|
||||||
editbox:SetBackdropColor(unpack(m.config.content_color))
|
editbox:SetBackdropColor(unpack(m.config.content_color))
|
||||||
editbox:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
editbox:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
||||||
|
|
||||||
@@ -384,7 +404,7 @@ do
|
|||||||
|
|
||||||
local dropdown = CreateFrame('Frame', 'aux_dropdown'..id, parent, 'UIDropDownMenuTemplate')
|
local dropdown = CreateFrame('Frame', 'aux_dropdown'..id, parent, 'UIDropDownMenuTemplate')
|
||||||
|
|
||||||
dropdown:SetBackdrop{bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=m.config.edge_size, insets={top=5,bottom=5}}
|
dropdown:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=m.config.edge_size, insets={top=5,bottom=5}}
|
||||||
dropdown:SetBackdropColor(unpack(m.config.content_color))
|
dropdown:SetBackdropColor(unpack(m.config.content_color))
|
||||||
dropdown:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
dropdown:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
||||||
local left = getglobal(dropdown:GetName()..'Left'):Hide()
|
local left = getglobal(dropdown:GetName()..'Left'):Hide()
|
||||||
@@ -479,7 +499,7 @@ function public.slider(frame, name)
|
|||||||
slider:SetHeight(6)
|
slider:SetHeight(6)
|
||||||
slider:SetHitRectInsets(0, 0, -8, -8)
|
slider:SetHitRectInsets(0, 0, -8, -8)
|
||||||
slider:SetValue(0)
|
slider:SetValue(0)
|
||||||
slider:SetBackdrop{ bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=m.config.edge_size }
|
slider:SetBackdrop{ bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=m.config.edge_size }
|
||||||
slider:SetBackdropColor(unpack(m.config.frame_color))
|
slider:SetBackdropColor(unpack(m.config.frame_color))
|
||||||
slider:SetBackdropBorderColor(unpack(m.config.frame_border_color))
|
slider:SetBackdropBorderColor(unpack(m.config.frame_border_color))
|
||||||
local thumb_texture = slider:CreateTexture(nil, 'ARTWORK')
|
local thumb_texture = slider:CreateTexture(nil, 'ARTWORK')
|
||||||
@@ -504,7 +524,7 @@ function public.slider(frame, name)
|
|||||||
editbox:SetWidth(70)
|
editbox:SetWidth(70)
|
||||||
editbox:SetJustifyH('CENTER')
|
editbox:SetJustifyH('CENTER')
|
||||||
editbox:EnableMouse(true)
|
editbox:EnableMouse(true)
|
||||||
editbox:SetBackdrop{ bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=m.config.edge_size }
|
editbox:SetBackdrop{ bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=m.config.edge_size }
|
||||||
editbox:SetBackdropColor(unpack(m.config.content_color))
|
editbox:SetBackdropColor(unpack(m.config.content_color))
|
||||||
editbox:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
editbox:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
||||||
-- editbox:SetFont(m.config.content_font, m.config.normal_font_size)
|
-- editbox:SetFont(m.config.content_font, m.config.normal_font_size)
|
||||||
@@ -538,7 +558,7 @@ end
|
|||||||
-- checkbox:SetWidth(16)
|
-- checkbox:SetWidth(16)
|
||||||
-- checkbox:SetHeight(16)
|
-- checkbox:SetHeight(16)
|
||||||
-- checkbox:SetPoint('TOPLEFT', 4, -4)
|
-- checkbox:SetPoint('TOPLEFT', 4, -4)
|
||||||
-- checkbox:SetBackdrop({ bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=m.config.edge_size })
|
-- checkbox:SetBackdrop({ bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=m.config.edge_size })
|
||||||
-- checkbox:SetBackdropColor(unpack(m.config.content_color))
|
-- checkbox:SetBackdropColor(unpack(m.config.content_color))
|
||||||
-- checkbox:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
-- checkbox:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
||||||
-- local highlight = checkbox:CreateTexture(nil, 'HIGHLIGHT')
|
-- local highlight = checkbox:CreateTexture(nil, 'HIGHLIGHT')
|
||||||
|
|||||||
@@ -655,7 +655,7 @@ local methods = {
|
|||||||
elseif Aux.unmodified() and button == 'RightButton' then -- TODO not when alt (how?)
|
elseif Aux.unmodified() and button == 'RightButton' then -- TODO not when alt (how?)
|
||||||
Aux.tab_group:set_tab(1)
|
Aux.tab_group:set_tab(1)
|
||||||
Aux.search_tab.set_filter(strlower(Aux.info.item(this.row.data.record.item_id).name)..'/exact')
|
Aux.search_tab.set_filter(strlower(Aux.info.item(this.row.data.record.item_id).name)..'/exact')
|
||||||
if m.real_time_button.on then
|
if m.real_time_button:GetChecked() then
|
||||||
m.real_time_button:Click()
|
m.real_time_button:Click()
|
||||||
end
|
end
|
||||||
Aux.search_tab.execute()
|
Aux.search_tab.execute()
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ Aux.post_tab.FRAMES(function(m, public, private)
|
|||||||
elseif arg1 == 'RightButton' then
|
elseif arg1 == 'RightButton' then
|
||||||
Aux.tab_group:set_tab(1)
|
Aux.tab_group:set_tab(1)
|
||||||
Aux.search_tab.set_filter(strlower(Aux.info.item(this.item_record.item_id).name)..'/exact')
|
Aux.search_tab.set_filter(strlower(Aux.info.item(this.item_record.item_id).name)..'/exact')
|
||||||
if m.real_time_button.on then
|
if m.real_time_button:GetChecked() then
|
||||||
m.real_time_button:Click()
|
m.real_time_button:Click()
|
||||||
end
|
end
|
||||||
Aux.search_tab.execute()
|
Aux.search_tab.execute()
|
||||||
|
|||||||
+53
-41
@@ -19,33 +19,15 @@ StaticPopupDialogs['AUX_SEARCH_AUTO_BUY'] = {
|
|||||||
button1 = 'Yes',
|
button1 = 'Yes',
|
||||||
button2 = 'No',
|
button2 = 'No',
|
||||||
OnAccept = function()
|
OnAccept = function()
|
||||||
m.auto_buy_button.on = true
|
m.auto_buy_button:SetChecked(true)
|
||||||
m.auto_buy_button:SetBackdropColor(0.3, 0.7, 0.3)
|
|
||||||
end,
|
end,
|
||||||
timeout = 0,
|
timeout = 0,
|
||||||
hideOnEscape = 1,
|
hideOnEscape = 1,
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
local function action()
|
local function action()
|
||||||
local queries = Aux.scan_util.parse_filter_string(getglobal(this:GetParent():GetName()..'EditBox'):GetText())
|
aux_auto_buy_filter = getglobal(this:GetParent():GetName()..'EditBox'):GetText()
|
||||||
if queries then
|
m.update_auto_buy_filter()
|
||||||
|
|
||||||
if getn(queries) > 1 then
|
|
||||||
Aux.log('Error: The automatic buyout filter may contain only one query')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if Aux.util.size(queries[1].blizzard_query) > 0 then
|
|
||||||
Aux.log('Error: The automatic buyout filter does not support Blizzard filters')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
aux_auto_buy_filter = m.auto_buy_filter_editbox:GetText()
|
|
||||||
m.auto_buy_validator = queries[1].validator
|
|
||||||
m.auto_buy_filter_button.on = true
|
|
||||||
m.auto_buy_button:SetBackdropColor(0.3, 0.7, 0.3)
|
|
||||||
m.auto_buy_filter_editbox:ClearFocus()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
StaticPopupDialogs['AUX_SEARCH_AUTO_BUY_FILTER'] = {
|
StaticPopupDialogs['AUX_SEARCH_AUTO_BUY_FILTER'] = {
|
||||||
@@ -88,6 +70,7 @@ function public.LOAD()
|
|||||||
m.create_frames(m, public, private)
|
m.create_frames(m, public, private)
|
||||||
m.update_search()
|
m.update_search()
|
||||||
m.update_tab(m.SAVED)
|
m.update_tab(m.SAVED)
|
||||||
|
m.update_auto_buy_filter()
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.OPEN()
|
function public.OPEN()
|
||||||
@@ -167,6 +150,25 @@ function private.add_filter(filter_string, replace)
|
|||||||
m.search_box:SetText((old_filter_string or '')..filter_string)
|
m.search_box:SetText((old_filter_string or '')..filter_string)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function private.update_auto_buy_filter()
|
||||||
|
if aux_auto_buy_filter then
|
||||||
|
local queries = Aux.scan_util.parse_filter_string(aux_auto_buy_filter)
|
||||||
|
if queries then
|
||||||
|
if getn(queries) > 1 then
|
||||||
|
Aux.log('Error: The automatic buyout filter may contain only one query')
|
||||||
|
elseif Aux.util.size(queries[1].blizzard_query) > 0 then
|
||||||
|
Aux.log('Error: The automatic buyout filter does not support Blizzard filters')
|
||||||
|
else
|
||||||
|
m.auto_buy_validator = queries[1].validator
|
||||||
|
m.auto_buy_filter_button.prettified = queries[1].prettified
|
||||||
|
m.auto_buy_filter_button:SetChecked(true)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
aux_auto_buy_filter = nil
|
||||||
|
end
|
||||||
|
|
||||||
function private.close_settings()
|
function private.close_settings()
|
||||||
if m.settings_button.open then
|
if m.settings_button.open then
|
||||||
m.settings_button:Click()
|
m.settings_button:Click()
|
||||||
@@ -198,12 +200,14 @@ function private.get_form_filter()
|
|||||||
add('exact')
|
add('exact')
|
||||||
end
|
end
|
||||||
|
|
||||||
if tonumber(m.min_level_input:GetText()) then
|
local min_level = m.blizzard_level(m.min_level_input:GetText())
|
||||||
add(max(1, min(60, tonumber(m.min_level_input:GetText()))))
|
if min_level then
|
||||||
|
add(min_level)
|
||||||
end
|
end
|
||||||
|
|
||||||
if tonumber(m.max_level_input:GetText()) then
|
local max_level = m.blizzard_level(m.min_level_input:GetText())
|
||||||
add(max(1, min(60, tonumber(m.max_level_input:GetText()))))
|
if max_level then
|
||||||
|
add(max_level)
|
||||||
end
|
end
|
||||||
|
|
||||||
if m.usable_checkbox:GetChecked() then
|
if m.usable_checkbox:GetChecked() then
|
||||||
@@ -265,7 +269,7 @@ function private.start_real_time_scan(query, search, continuation)
|
|||||||
m.search_scan_id = Aux.scan.start{
|
m.search_scan_id = Aux.scan.start{
|
||||||
type = 'list',
|
type = 'list',
|
||||||
queries = {query},
|
queries = {query},
|
||||||
auto_buy_validator = m.auto_buy_validator,
|
auto_buy_validator = m.auto_buy_filter_button:GetChecked() and aux_auto_buy_filter and m.auto_buy_validator, -- some redundancy but why not to be save
|
||||||
on_scan_start = function()
|
on_scan_start = function()
|
||||||
m.status_bar:update_status(99.99, 99.99)
|
m.status_bar:update_status(99.99, 99.99)
|
||||||
m.status_bar:set_text('Scanning last page ...')
|
m.status_bar:set_text('Scanning last page ...')
|
||||||
@@ -278,7 +282,7 @@ function private.start_real_time_scan(query, search, continuation)
|
|||||||
end,
|
end,
|
||||||
on_auction = function(auction_record, ctrl)
|
on_auction = function(auction_record, ctrl)
|
||||||
if not ignore_page then
|
if not ignore_page then
|
||||||
if m.auto_buy_button.on then
|
if m.auto_buy_button:GetChecked() then
|
||||||
ctrl.suspend()
|
ctrl.suspend()
|
||||||
Aux.place_bid('list', auction_record.index, auction_record.buyout_price, function() ctrl.resume(true) end)
|
Aux.place_bid('list', auction_record.index, auction_record.buyout_price, function() ctrl.resume(true) end)
|
||||||
else
|
else
|
||||||
@@ -370,7 +374,7 @@ function private.start_search(queries, continuation)
|
|||||||
current_page = current_page and 0 or start_page - 1
|
current_page = current_page and 0 or start_page - 1
|
||||||
end,
|
end,
|
||||||
on_auction = function(auction_record, ctrl)
|
on_auction = function(auction_record, ctrl)
|
||||||
if m.auto_buy_button.on then
|
if m.auto_buy_button:GetChecked() then
|
||||||
ctrl.suspend()
|
ctrl.suspend()
|
||||||
Aux.place_bid('list', auction_record.index, auction_record.buyout_price, function() ctrl.resume(true) end)
|
Aux.place_bid('list', auction_record.index, auction_record.buyout_price, function() ctrl.resume(true) end)
|
||||||
elseif getn(search.records) < 1000 then
|
elseif getn(search.records) < 1000 then
|
||||||
@@ -417,12 +421,12 @@ function public.execute(resume)
|
|||||||
local queries = Aux.scan_util.parse_filter_string(filter_string)
|
local queries = Aux.scan_util.parse_filter_string(filter_string)
|
||||||
if not queries then
|
if not queries then
|
||||||
return
|
return
|
||||||
elseif m.real_time_button.on then
|
elseif m.real_time_button:GetChecked() then
|
||||||
if getn(queries) > 1 then
|
if getn(queries) > 1 then
|
||||||
Aux.log('Invalid filter: The sniping mode does not support multiple queries')
|
Aux.log('Invalid filter: The real time mode does not support multiple 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
|
||||||
Aux.log('Invalid filter: The sniping mode does not support page range filters')
|
Aux.log('Invalid filter: The real time mode does not support page range filters')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -434,7 +438,7 @@ function public.execute(resume)
|
|||||||
if resume then
|
if resume then
|
||||||
m.results_listing:SetSelectedRecord()
|
m.results_listing:SetSelectedRecord()
|
||||||
else
|
else
|
||||||
if m.current_search().real_time ~= m.real_time_button.on then
|
if m.current_search().real_time ~= m.real_time_button:GetChecked() then
|
||||||
m.results_listing:Reset()
|
m.results_listing:Reset()
|
||||||
end
|
end
|
||||||
m.current_search().records = {}
|
m.current_search().records = {}
|
||||||
@@ -448,22 +452,30 @@ function public.execute(resume)
|
|||||||
|
|
||||||
m.close_settings()
|
m.close_settings()
|
||||||
m.update_tab(m.RESULTS)
|
m.update_tab(m.RESULTS)
|
||||||
m.current_search().real_time = m.real_time_button.on
|
m.current_search().real_time = m.real_time_button:GetChecked()
|
||||||
if m.real_time_button.on then
|
if m.real_time_button:GetChecked() then
|
||||||
m.start_real_time_scan(queries[1], nil, continuation)
|
m.start_real_time_scan(queries[1], nil, continuation)
|
||||||
else
|
else
|
||||||
for _, query in queries do
|
for _, query in queries do
|
||||||
if tonumber(m.first_page_input:GetText()) then
|
query.blizzard_query.first_page = m.blizzard_page_index(m.first_page_input:GetText())
|
||||||
query.blizzard_query.first_page = Aux.round(max(0, m.first_page_input:GetNumber() - 1))
|
query.blizzard_query.last_page = m.blizzard_page_index(m.last_page_input:GetText())
|
||||||
end
|
|
||||||
if tonumber(m.last_page_input:GetText()) then
|
|
||||||
query.blizzard_query.last_page = Aux.round(max(0, m.last_page_input:GetNumber() - 1))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
m.start_search(queries, continuation)
|
m.start_search(queries, continuation)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function private.blizzard_page_index(str)
|
||||||
|
if tonumber(str) then
|
||||||
|
return Aux.round(max(0, tonumber(str) - 1))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function private.blizzard_level(str)
|
||||||
|
if tonumber(str) then
|
||||||
|
return Aux.round(max(1, min(60, tonumber(str))))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function private.test(record)
|
function private.test(record)
|
||||||
return function(index)
|
return function(index)
|
||||||
local auction_info = Aux.info.auction(index)
|
local auction_info = Aux.info.auction(index)
|
||||||
@@ -558,7 +570,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function private.update_continuation()
|
function private.update_continuation()
|
||||||
if m.current_search().continuation and m.current_search().real_time == m.real_time_button.on then
|
if m.current_search().continuation and m.current_search().real_time == m.real_time_button:GetChecked() then
|
||||||
m.resume_button:Show()
|
m.resume_button:Show()
|
||||||
m.search_box:SetPoint('RIGHT', m.resume_button, 'LEFT', -4, 0)
|
m.search_box:SetPoint('RIGHT', m.resume_button, 'LEFT', -4, 0)
|
||||||
else
|
else
|
||||||
|
|||||||
+56
-52
@@ -27,21 +27,6 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
btn:SetPoint('TOPLEFT', 0, 0)
|
btn:SetPoint('TOPLEFT', 0, 0)
|
||||||
btn:SetWidth(42)
|
btn:SetWidth(42)
|
||||||
btn:SetHeight(42)
|
btn:SetHeight(42)
|
||||||
local t1 = btn:CreateTexture()
|
|
||||||
t1:SetTexture(unpack(Aux.gui.config.text_color.enabled))
|
|
||||||
t1:SetWidth(20)
|
|
||||||
t1:SetHeight(2.5)
|
|
||||||
t1:SetPoint('CENTER', 0, 6.7)
|
|
||||||
local t2 = btn:CreateTexture()
|
|
||||||
t2:SetTexture(unpack(Aux.gui.config.text_color.enabled))
|
|
||||||
t2:SetWidth(20)
|
|
||||||
t2:SetHeight(2.5)
|
|
||||||
t2:SetPoint('CENTER', 0, 0)
|
|
||||||
local t3 = btn:CreateTexture()
|
|
||||||
t3:SetTexture(unpack(Aux.gui.config.text_color.enabled))
|
|
||||||
t3:SetWidth(20)
|
|
||||||
t3:SetHeight(2.5)
|
|
||||||
t3:SetPoint('CENTER', 0, -6.7)
|
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
if this.open then
|
if this.open then
|
||||||
m.settings:Hide()
|
m.settings:Hide()
|
||||||
@@ -53,6 +38,15 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
end
|
end
|
||||||
this.open = not this.open
|
this.open = not this.open
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
for _, offset in {15, 10, 5} do
|
||||||
|
local fake_icon_part = btn:CreateFontString()
|
||||||
|
fake_icon_part:SetFont([[Fonts\FRIZQT__.TTF]], 23)
|
||||||
|
fake_icon_part:SetPoint('CENTER', 0, offset)
|
||||||
|
fake_icon_part:SetText('_')
|
||||||
|
-- fake_icon:SetTextHeight(28)
|
||||||
|
end
|
||||||
|
|
||||||
private.settings_button = btn
|
private.settings_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -72,9 +66,8 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(m.settings)
|
local editbox = Aux.gui.editbox(m.settings)
|
||||||
editbox:SetBackdropColor(unpack(Aux.gui.config.frame_color))
|
editbox:SetPoint('LEFT', 70, 0)
|
||||||
editbox:SetPoint('LEFT', 80, 0)
|
editbox:SetWidth(50)
|
||||||
editbox:SetWidth(30)
|
|
||||||
editbox:SetNumeric(true)
|
editbox:SetNumeric(true)
|
||||||
editbox:SetMaxLetters(nil)
|
editbox:SetMaxLetters(nil)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
@@ -84,16 +77,23 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
this:ClearFocus()
|
this:ClearFocus()
|
||||||
m.execute()
|
m.execute()
|
||||||
end)
|
end)
|
||||||
|
editbox:SetScript('OnTextChanged', function()
|
||||||
|
if m.blizzard_page_index(this:GetText()) and not m.real_time_button:GetChecked() then
|
||||||
|
this:SetBackdropColor(unpack(Aux.gui.config.on_color))
|
||||||
|
else
|
||||||
|
this:SetBackdropColor(unpack(Aux.gui.config.off_color))
|
||||||
|
end
|
||||||
|
end)
|
||||||
local label = Aux.gui.label(editbox, 15)
|
local label = Aux.gui.label(editbox, 15)
|
||||||
label:SetPoint('RIGHT', editbox, 'LEFT', -5, 0)
|
label:SetPoint('RIGHT', editbox, 'LEFT', -5, 0)
|
||||||
label:SetText('Pages')
|
label:SetText('Pages')
|
||||||
|
label:SetTextColor(unpack(Aux.gui.config.text_color.enabled))
|
||||||
private.first_page_input = editbox
|
private.first_page_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(m.settings)
|
local editbox = Aux.gui.editbox(m.settings)
|
||||||
editbox:SetBackdropColor(unpack(Aux.gui.config.frame_color))
|
|
||||||
editbox:SetPoint('LEFT', m.first_page_input, 'RIGHT', 10, 0)
|
editbox:SetPoint('LEFT', m.first_page_input, 'RIGHT', 10, 0)
|
||||||
editbox:SetWidth(30)
|
editbox:SetWidth(50)
|
||||||
editbox:SetNumeric(true)
|
editbox:SetNumeric(true)
|
||||||
editbox:SetMaxLetters(nil)
|
editbox:SetMaxLetters(nil)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
@@ -103,48 +103,44 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
this:ClearFocus()
|
this:ClearFocus()
|
||||||
m.execute()
|
m.execute()
|
||||||
end)
|
end)
|
||||||
|
editbox:SetScript('OnTextChanged', function()
|
||||||
|
if m.blizzard_page_index(this:GetText()) and not m.real_time_button:GetChecked() then
|
||||||
|
this:SetBackdropColor(unpack(Aux.gui.config.on_color))
|
||||||
|
else
|
||||||
|
this:SetBackdropColor(unpack(Aux.gui.config.off_color))
|
||||||
|
end
|
||||||
|
end)
|
||||||
local label = Aux.gui.label(editbox, 16)
|
local label = Aux.gui.label(editbox, 16)
|
||||||
label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0)
|
label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0)
|
||||||
label:SetText('-')
|
label:SetText('-')
|
||||||
|
label:SetTextColor(unpack(Aux.gui.config.text_color.enabled))
|
||||||
private.last_page_input = editbox
|
private.last_page_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = Aux.gui.button(m.settings, 16)
|
local btn = Aux.gui.checkbutton(m.settings, 16)
|
||||||
btn:SetBackdropColor(unpack(Aux.gui.config.frame_color))
|
btn:SetPoint('LEFT', 230, 0)
|
||||||
btn:SetPoint('LEFT', 240, 0)
|
|
||||||
btn:SetWidth(140)
|
btn:SetWidth(140)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetText('Real Time Mode')
|
btn:SetText('Real Time Mode')
|
||||||
btn:SetBackdropColor(0.7, 0.3, 0.3)
|
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
this.on = not this.on
|
this:SetChecked(not this:GetChecked())
|
||||||
if this.on then
|
this = m.first_page_input
|
||||||
this:SetBackdropColor(0.3, 0.7, 0.3)
|
m.first_page_input:GetScript('OnTextChanged')()
|
||||||
m.first_page_input:EnableMouse(nil)
|
this = m.last_page_input
|
||||||
m.last_page_input:EnableMouse(nil)
|
m.last_page_input:GetScript('OnTextChanged')()
|
||||||
m.first_page_input:ClearFocus()
|
|
||||||
m.last_page_input:ClearFocus()
|
|
||||||
else
|
|
||||||
this:SetBackdropColor(0.7, 0.3, 0.3)
|
|
||||||
m.first_page_input:EnableMouse(true)
|
|
||||||
m.last_page_input:EnableMouse(true)
|
|
||||||
end
|
|
||||||
m.update_continuation()
|
m.update_continuation()
|
||||||
end)
|
end)
|
||||||
public.real_time_button = btn
|
public.real_time_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = Aux.gui.button(m.settings, 16)
|
local btn = Aux.gui.checkbutton(m.settings, 16)
|
||||||
btn:SetBackdropColor(unpack(Aux.gui.config.frame_color))
|
btn:SetPoint('LEFT', m.real_time_button, 'RIGHT', 15, 0)
|
||||||
btn:SetPoint('LEFT', m.real_time_button, 'RIGHT', 30, 0)
|
|
||||||
btn:SetWidth(140)
|
btn:SetWidth(140)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetText('Auto Buyout Mode')
|
btn:SetText('Auto Buyout Mode')
|
||||||
btn:SetBackdropColor(0.7, 0.3, 0.3)
|
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
if this.on then
|
if this:GetChecked() then
|
||||||
this.on = false
|
this:SetChecked(false)
|
||||||
this:SetBackdropColor(0.7, 0.3, 0.3)
|
|
||||||
else
|
else
|
||||||
StaticPopup_Show('AUX_SEARCH_AUTO_BUY')
|
StaticPopup_Show('AUX_SEARCH_AUTO_BUY')
|
||||||
end
|
end
|
||||||
@@ -152,22 +148,31 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
private.auto_buy_button = btn
|
private.auto_buy_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = Aux.gui.button(m.settings, 16)
|
local btn = Aux.gui.checkbutton(m.settings, 16)
|
||||||
btn:SetBackdropColor(unpack(Aux.gui.config.frame_color))
|
btn:SetPoint('LEFT', m.auto_buy_button, 'RIGHT', 15, 0)
|
||||||
btn:SetPoint('LEFT', m.auto_buy_button, 'RIGHT', 30, 0)
|
|
||||||
btn:SetWidth(140)
|
btn:SetWidth(140)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetText('Auto Buyout Filter')
|
btn:SetText('Auto Buyout Filter')
|
||||||
btn:SetBackdropColor(0.7, 0.3, 0.3)
|
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
if this.on then
|
if this:GetChecked() then
|
||||||
this.on = false
|
this:SetChecked(false)
|
||||||
|
aux_auto_buy_filter = nil
|
||||||
|
this.prettified = nil
|
||||||
m.auto_buy_validator = nil
|
m.auto_buy_validator = nil
|
||||||
this:SetBackdropColor(0.7, 0.3, 0.3)
|
|
||||||
else
|
else
|
||||||
StaticPopup_Show('AUX_SEARCH_AUTO_BUY_FILTER')
|
StaticPopup_Show('AUX_SEARCH_AUTO_BUY_FILTER')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
btn:SetScript('OnEnter', function()
|
||||||
|
if this.prettified then
|
||||||
|
GameTooltip_SetDefaultAnchor(GameTooltip, UIParent)
|
||||||
|
GameTooltip:AddLine(gsub(this.prettified, ';', '\n\n'), 255/255, 254/255, 250/255, true)
|
||||||
|
GameTooltip:Show()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
btn:SetScript('OnLeave', function()
|
||||||
|
GameTooltip:Hide()
|
||||||
|
end)
|
||||||
private.auto_buy_filter_button = btn
|
private.auto_buy_filter_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -248,7 +253,7 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
local item_info = Aux.cursor_item() and Aux.info.item(Aux.cursor_item().item_id)
|
local item_info = Aux.cursor_item() and Aux.info.item(Aux.cursor_item().item_id)
|
||||||
if item_info then
|
if item_info then
|
||||||
m.set_filter(strlower(item_info.name)..'/exact')
|
m.set_filter(strlower(item_info.name)..'/exact')
|
||||||
if m.real_time_button.on then
|
if m.real_time_button:GetChecked() then
|
||||||
m.real_time_button:Click()
|
m.real_time_button:Click()
|
||||||
end
|
end
|
||||||
m.execute()
|
m.execute()
|
||||||
@@ -759,7 +764,6 @@ Aux.search_tab.FRAMES(function(m, public, private)
|
|||||||
GameTooltip_SetDefaultAnchor(GameTooltip, UIParent)
|
GameTooltip_SetDefaultAnchor(GameTooltip, UIParent)
|
||||||
GameTooltip:AddLine(gsub(data.search.prettified, ';', '\n\n'), 255/255, 254/255, 250/255, true)
|
GameTooltip:AddLine(gsub(data.search.prettified, ';', '\n\n'), 255/255, 254/255, 250/255, true)
|
||||||
GameTooltip:Show()
|
GameTooltip:Show()
|
||||||
GameTooltip:Show()
|
|
||||||
end,
|
end,
|
||||||
OnLeave = function()
|
OnLeave = function()
|
||||||
GameTooltip:ClearLines()
|
GameTooltip:ClearLines()
|
||||||
|
|||||||
Reference in New Issue
Block a user