big refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-17 15:08:11 +02:00
parent 2a7dea236d
commit 3624c8c4c0
34 changed files with 357 additions and 447 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
local m, public, private = aux.tab(3, 'Auctions', 'auctions_tab')
aux.module 'auctions_tab'
aux.tab(3, 'Auctions', 'auctions_tab')
private.auction_records = nil
+1 -1
View File
@@ -1,4 +1,4 @@
local m, public, private = aux.module'auctions_tab'
aux.module 'auctions_tab'
function private.create_frames()
private.frame = CreateFrame('Frame', nil, aux.frame)
+2 -1
View File
@@ -1,4 +1,5 @@
local m, public, private = aux.tab(4, 'Bids', 'bids_tab')
aux.module 'bids_tab'
aux.tab(4, 'Bids', 'bids_tab')
private.auction_records = nil
+1 -1
View File
@@ -1,4 +1,4 @@
local m, public, private = aux.module'bids_tab'
aux.module 'bids_tab'
function private.create_frames()
private.frame = CreateFrame('Frame', nil, aux.frame)
+2 -1
View File
@@ -1,4 +1,5 @@
local m, public, private = aux.tab(2, 'Post', 'post_tab')
aux.module 'post_tab'
aux.tab(2, 'Post', 'post_tab')
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'}}
+2 -2
View File
@@ -1,4 +1,4 @@
local m, public, private = aux.module'post_tab'
aux.module 'post_tab'
function private.create_frames()
private.frame = CreateFrame('Frame', nil, aux.frame)
@@ -46,7 +46,7 @@ function private.create_frames()
if arg1 == 'LeftButton' then
m.set_item(this.item_record)
elseif arg1 == 'RightButton' then
aux.tab_group:set_tab(1)
aux.set_tab(1)
aux.search_tab.set_filter(strlower(aux.info.item(this.item_record.item_id).name)..'/exact')
aux.search_tab.execute(nil, false)
end
+3 -1
View File
@@ -1,4 +1,5 @@
local m, public, private = aux.tab(1, 'Search', 'search_tab')
aux.module 'search_tab'
aux.tab(1, 'Search', 'search_tab')
StaticPopupDialogs['AUX_SEARCH_TABLE_FULL'] = {
text = 'Table full!\nFurther results from this search will still be processed but no longer displayed in the table.',
@@ -58,6 +59,7 @@ function m.LOAD()
end
function m.OPEN()
aux.log('kek2')
m.frame:Show()
m.update_search_listings()
end
+6 -34
View File
@@ -1,4 +1,4 @@
local m, public, private = aux.module'search_tab'
aux.module 'search_tab'
function private.valid_level(str)
local level = tonumber(str)
@@ -109,7 +109,7 @@ function private.get_filter_builder_query()
end
local name = m.blizzard_query.name
if aux.index(aux.filter.parse_query_string(name), 'blizzard', 1, 1) ~= 'name' then
if not aux.index(aux.filter.parse_query_string(name), 'blizzard', 'name') then
name = aux.filter.quote(name)
end
add((name ~= '' or m.blizzard_query.exact) and name)
@@ -134,7 +134,7 @@ function private.get_filter_builder_query()
add(strlower(getglobal('ITEM_QUALITY'..quality..'_DESC')))
end
local post_filter_string = aux.filter.query_string({blizzard={}, post=m.post_filter})
local post_filter_string = aux.filter.query_string{blizzard={}, post=m.post_filter}
add(post_filter_string ~= '' and post_filter_string)
return query_string or ''
@@ -142,37 +142,9 @@ end
function private.set_form(components)
m.clear_form()
local class_index, subclass_index
for _, filter in components.blizzard do
if filter[1] == 'name' then
local name = filter[2]
if name and strsub(name, 1, 1) == '"' and strsub(name, -1, -1) == '"' then
name = strsub(name, 2, -2)
end
m.blizzard_query.name = aux.filter.unquote(filter[2])
elseif filter[1] == 'exact' then
m.blizzard_query.exact = true
elseif filter[1] == 'min_level' then
m.min_level_input:SetText(tonumber(filter[2]))
elseif filter[1] == 'max_level' then
m.max_level_input:SetText(tonumber(filter[2]))
elseif filter[1] == 'usable' then
m.blizzard_query.usable = true
elseif filter[1] == 'class' then
class_index = aux.info.item_class_index(filter[2])
m.blizzard_query.class = class_index
elseif filter[1] == 'subclass' then
subclass_index = aux.info.item_subclass_index(class_index, filter[2])
m.blizzard_query.subclass = subclass_index
elseif filter[1] == 'slot' then
m.blizzard_query.slot = ({GetAuctionInvTypes(class_index, subclass_index)})[aux.info.item_slot_index(class_index, subclass_index, filter[2])]
elseif filter[1] == 'quality' then
m.blizzard_query.quality = aux.info.item_quality_index(filter[2])
end
for key, filter in components.blizzard do
m.blizzard_query[key] = filter[2]
end
for _, component in components.post do
m.add_component(component)
end
@@ -199,7 +171,7 @@ function private.clear_form()
end
function private.import_query_string()
local components, error = aux.filter.parse_query_string(({strfind(m.search_box:GetText(), '^([^;]*)')})[3])
local components, error = aux.filter.parse_query_string(aux.util.select(3, strfind(m.search_box:GetText(), '^([^;]*)')))
if components then
m.set_form(components)
else
+1 -1
View File
@@ -1,4 +1,4 @@
local m, public, private = aux.module'search_tab'
aux.module 'search_tab'
private.FILTER_SPACING = 28.5
+1 -1
View File
@@ -1,4 +1,4 @@
local m, public, private = aux.module'search_tab'
aux.module 'search_tab'
aux_auto_buy_filter = ''
+1 -1
View File
@@ -1,4 +1,4 @@
local m, public, private = aux.module'search_tab'
aux.module 'search_tab'
aux_favorite_searches = {}
aux_recent_searches = {}