big refactoring
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
aux.module 'auctions_tab'
|
||||
g.aux.tab(3, 'Auctions')
|
||||
aux.tab(3, 'Auctions')
|
||||
|
||||
auction_records = nil
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
aux.module 'bids_tab'
|
||||
g.aux.tab(4, 'Bids')
|
||||
aux.tab(4, 'Bids')
|
||||
|
||||
auction_records = nil
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
aux.module 'post_tab'
|
||||
g.aux.tab(2, 'Post')
|
||||
aux.tab(2, 'Post')
|
||||
|
||||
local DURATION_4, DURATION_8, DURATION_24 = 120, 480, 1440
|
||||
local settings_schema = {'record', '#', {stack_size='number'}, {duration='number'}, {start_price='number'}, {buyout_price='number'}, {hidden='boolean'}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
aux.module 'search_tab'
|
||||
g.aux.tab(1, 'Search')
|
||||
aux.tab(1, '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.',
|
||||
@@ -20,7 +20,7 @@ StaticPopupDialogs['AUX_SEARCH_AUTO_BUY'] = {
|
||||
}
|
||||
do
|
||||
local function action()
|
||||
g.aux_auto_buy_filter = getglobal(this:GetParent():GetName()..'EditBox'):GetText()
|
||||
_g.aux_auto_buy_filter = getglobal(this:GetParent():GetName()..'EditBox'):GetText()
|
||||
update_auto_buy_filter()
|
||||
end
|
||||
|
||||
|
||||
+14
-14
@@ -118,9 +118,9 @@ function create_frames()
|
||||
btn:SetText('Real Time Mode')
|
||||
btn:SetScript('OnClick', function()
|
||||
this:SetChecked(not this:GetChecked())
|
||||
g.this = first_page_input
|
||||
_g.this = first_page_input
|
||||
first_page_input:GetScript('OnTextChanged')()
|
||||
g.this = last_page_input
|
||||
_g.this = last_page_input
|
||||
last_page_input:GetScript('OnTextChanged')()
|
||||
end)
|
||||
public.real_time_button = btn
|
||||
@@ -149,7 +149,7 @@ function create_frames()
|
||||
btn:SetScript('OnClick', function()
|
||||
if this:GetChecked() then
|
||||
this:SetChecked(false)
|
||||
g.aux_auto_buy_filter = nil
|
||||
_g.aux_auto_buy_filter = nil
|
||||
this.prettified = nil
|
||||
auto_buy_validator = nil
|
||||
else
|
||||
@@ -313,7 +313,7 @@ function create_frames()
|
||||
btn:SetScript('OnClick', function()
|
||||
local filters = filter.queries(search_box:GetText())
|
||||
if filters then
|
||||
tinsert(g.aux_favorite_searches, 1, {
|
||||
tinsert(_g.aux_favorite_searches, 1, {
|
||||
filter_string = search_box:GetText(),
|
||||
prettified = table.concat(map(filters, function(filter) return filter.prettified end), ';'),
|
||||
})
|
||||
@@ -345,7 +345,7 @@ function create_frames()
|
||||
end
|
||||
do
|
||||
local editbox = gui.editbox(frame.filter)
|
||||
editbox.complete_item = completion.complete(function() return g.aux_auctionable_items end)
|
||||
editbox.complete_item = completion.complete(function() return _g.aux_auctionable_items end)
|
||||
editbox:SetPoint('TOPLEFT', 14, -FILTER_SPACING)
|
||||
editbox:SetWidth(260)
|
||||
editbox.char = function()
|
||||
@@ -623,16 +623,16 @@ function create_frames()
|
||||
add_filter(data.search.filter_string)
|
||||
elseif button == 'LeftButton' and IsControlKeyDown() then
|
||||
if st == favorite_searches_listing and data.index > 1 then
|
||||
local temp = g.aux_favorite_searches[data.index - 1]
|
||||
g.aux_favorite_searches[data.index - 1] = data.search
|
||||
g.aux_favorite_searches[data.index] = temp
|
||||
local temp = _g.aux_favorite_searches[data.index - 1]
|
||||
_g.aux_favorite_searches[data.index - 1] = data.search
|
||||
_g.aux_favorite_searches[data.index] = temp
|
||||
update_search_listings()
|
||||
end
|
||||
elseif button == 'RightButton' and IsControlKeyDown() then
|
||||
if st == favorite_searches_listing and data.index < getn(g.aux_favorite_searches) then
|
||||
local temp = g.aux_favorite_searches[data.index + 1]
|
||||
g.aux_favorite_searches[data.index + 1] = data.search
|
||||
g.aux_favorite_searches[data.index] = temp
|
||||
if st == favorite_searches_listing and data.index < getn(_g.aux_favorite_searches) then
|
||||
local temp = _g.aux_favorite_searches[data.index + 1]
|
||||
_g.aux_favorite_searches[data.index + 1] = data.search
|
||||
_g.aux_favorite_searches[data.index] = temp
|
||||
update_search_listings()
|
||||
end
|
||||
elseif button == 'LeftButton' then
|
||||
@@ -640,9 +640,9 @@ function create_frames()
|
||||
execute()
|
||||
elseif button == 'RightButton' then
|
||||
if st == recent_searches_listing then
|
||||
tinsert(g.aux_favorite_searches, 1, data.search)
|
||||
tinsert(_g.aux_favorite_searches, 1, data.search)
|
||||
elseif st == favorite_searches_listing then
|
||||
tremove(g.aux_favorite_searches, data.index)
|
||||
tremove(_g.aux_favorite_searches, data.index)
|
||||
end
|
||||
update_search_listings()
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
aux.module 'search_tab'
|
||||
|
||||
g.aux_auto_buy_filter = ''
|
||||
_g.aux_auto_buy_filter = ''
|
||||
|
||||
search_scan_id = 0
|
||||
auto_buy_validator = nil
|
||||
@@ -114,8 +114,8 @@ function update_start_stop()
|
||||
end
|
||||
|
||||
function update_auto_buy_filter()
|
||||
if g.aux_auto_buy_filter ~= '' then
|
||||
local queries = filter.queries(g.aux_auto_buy_filter)
|
||||
if _g.aux_auto_buy_filter ~= '' then
|
||||
local queries = filter.queries(_g.aux_auto_buy_filter)
|
||||
if queries then
|
||||
if getn(queries) > 1 then
|
||||
log('Error: The automatic buyout filter may contain only one query')
|
||||
@@ -129,7 +129,7 @@ function update_auto_buy_filter()
|
||||
end
|
||||
end
|
||||
end
|
||||
g.aux_auto_buy_filter = ''
|
||||
_g.aux_auto_buy_filter = ''
|
||||
end
|
||||
|
||||
function start_real_time_scan(query, search, continuation)
|
||||
|
||||
+10
-10
@@ -1,11 +1,11 @@
|
||||
aux.module 'search_tab'
|
||||
|
||||
g.aux_favorite_searches = {}
|
||||
g.aux_recent_searches = {}
|
||||
_g.aux_favorite_searches = {}
|
||||
_g.aux_recent_searches = {}
|
||||
|
||||
function update_search_listings()
|
||||
local favorite_search_rows = {}
|
||||
for i, favorite_search in g.aux_favorite_searches do
|
||||
for i, favorite_search in _g.aux_favorite_searches do
|
||||
local name = strsub(favorite_search.prettified, 1, 250)
|
||||
tinsert(favorite_search_rows, {
|
||||
cols = {{value=name}},
|
||||
@@ -13,10 +13,10 @@ function update_search_listings()
|
||||
index = i,
|
||||
})
|
||||
end
|
||||
m.favorite_searches_listing:SetData(favorite_search_rows)
|
||||
favorite_searches_listing:SetData(favorite_search_rows)
|
||||
|
||||
local recent_search_rows = {}
|
||||
for i, recent_search in g.aux_recent_searches do
|
||||
for i, recent_search in _g.aux_recent_searches do
|
||||
local name = strsub(recent_search.prettified, 1, 250)
|
||||
tinsert(recent_search_rows, {
|
||||
cols = {{value=name}},
|
||||
@@ -24,16 +24,16 @@ function update_search_listings()
|
||||
index = i,
|
||||
})
|
||||
end
|
||||
m.recent_searches_listing:SetData(recent_search_rows)
|
||||
recent_searches_listing:SetData(recent_search_rows)
|
||||
end
|
||||
|
||||
function new_recent_search(filter_string, prettified)
|
||||
tinsert(g.aux_recent_searches, 1, {
|
||||
tinsert(_g.aux_recent_searches, 1, {
|
||||
filter_string = filter_string,
|
||||
prettified = prettified,
|
||||
})
|
||||
while getn(g.aux_recent_searches) > 50 do
|
||||
tremove(g.aux_recent_searches)
|
||||
while getn(_g.aux_recent_searches) > 50 do
|
||||
tremove(_g.aux_recent_searches)
|
||||
end
|
||||
m.update_search_listings()
|
||||
update_search_listings()
|
||||
end
|
||||
Reference in New Issue
Block a user