working on module refactoring
This commit is contained in:
@@ -50,13 +50,6 @@ do
|
||||
end)
|
||||
end
|
||||
|
||||
function LOAD()
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
aux_frame.create()
|
||||
end
|
||||
|
||||
private.tab_info = t
|
||||
function public.TAB(name)
|
||||
local tab = T('name', name)
|
||||
|
||||
+2
-2
@@ -9,9 +9,9 @@ libs\module.lua
|
||||
libs\green_t.lua
|
||||
|
||||
aux-addon.lua
|
||||
util\core.lua
|
||||
util.lua
|
||||
control.lua
|
||||
util\color.lua
|
||||
color.lua
|
||||
gui\core.lua
|
||||
frame.lua
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
module 'aux.util.color'
|
||||
|
||||
include 'green_t'
|
||||
include 'aux'
|
||||
include 'aux.util'
|
||||
include 'aux.control'
|
||||
module 'aux'
|
||||
|
||||
local COLORS = {
|
||||
text = {enabled = {255, 254, 250, 1}, disabled = {147, 151, 139, 1}},
|
||||
+1
-5
@@ -1,8 +1,4 @@
|
||||
module 'aux.control'
|
||||
|
||||
include 'green_t'
|
||||
include 'aux'
|
||||
include 'aux.util'
|
||||
module 'aux'
|
||||
|
||||
local event_frame = CreateFrame'Frame'
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
module 'aux.frame'
|
||||
module 'aux'
|
||||
|
||||
local gui = require 'aux.gui'
|
||||
|
||||
function public.create()
|
||||
setfenv(1, getfenv(2))
|
||||
function private.create_frame()
|
||||
do
|
||||
local frame = CreateFrame('Frame', 'AuxFrame', UIParent)
|
||||
tinsert(UISpecialFrames, 'AuxFrame')
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
green_t = module
|
||||
library 'green_t'
|
||||
|
||||
local next, getn, setn, tremove, type, setmetatable = next, getn, table.setn, tremove, type, setmetatable
|
||||
|
||||
@@ -16,7 +16,7 @@ do
|
||||
end
|
||||
public.wipe = wipe
|
||||
|
||||
CreateFrame('Frame'):SetScript('OnUpdate', function()
|
||||
CreateFrame'Frame':SetScript('OnUpdate', function()
|
||||
for t in auto_release do release(t) end
|
||||
wipe(auto_release)
|
||||
end)
|
||||
|
||||
+14
-13
@@ -15,7 +15,7 @@ local function proxy_mt(fields, mutators)
|
||||
return { __metatable=false, __index=fields, __newindex=function(_, k, v) return mutators[k](v) end }
|
||||
end
|
||||
|
||||
local loaded, _module, _access, _name = {}, {}, {}, {}
|
||||
local loaded, _interface, _environment, _access, _name = {}, {}, {}, {}, {}
|
||||
|
||||
local definition_helper_mt = { __metatable=false }
|
||||
function definition_helper_mt:__index(k)
|
||||
@@ -24,7 +24,7 @@ function definition_helper_mt:__index(k)
|
||||
end
|
||||
function definition_helper_mt:__newindex(k, v)
|
||||
local module, name, mode
|
||||
module, name = _module[self], _name[self]
|
||||
module, name = loaded[self], _name[self]
|
||||
if name then mode = META[k] or error('Invalid modifier "%s"', k) else name, mode = k, FIELD end
|
||||
if type(name) ~= 'string' or not strfind(name, '^[_%a][_%w]*') then error('Invalid identifier "%s".', name) end
|
||||
module.defined[name .. OPERATION[mode]] = module.defined[name .. OPERATION[mode]] and error('Duplicate identifier "%s".', name) or true
|
||||
@@ -32,10 +32,10 @@ function definition_helper_mt:__newindex(k, v)
|
||||
_access[self], _name[self] = nil, nil
|
||||
end
|
||||
|
||||
local function require(name) return loaded[name] end
|
||||
local function require(name) return _interface[name] end
|
||||
|
||||
local function include(self, name)
|
||||
local module = name and _module[name] or error('No module "%s".', name)
|
||||
local module = name and loaded[name] or error('No module "%s".', name)
|
||||
for _, mode in MODES do
|
||||
for k, v in module[PUBLIC + mode] do
|
||||
if not self.defined[k .. OPERATION[mode]] or error('Import conflict for "%s".', k) then
|
||||
@@ -47,14 +47,13 @@ end
|
||||
|
||||
local nop_default_mt = { __index=function() return nop end }
|
||||
|
||||
function module(name)
|
||||
-- if loaded[name] then _G.error(nil) end
|
||||
local module, environment, interface, definition_helper, modifiers, accessors, mutators, fields, public_accessors, public_mutators, public_fields
|
||||
local function create_module(name)
|
||||
local P, environment, interface, definition_helper, modifiers, accessors, mutators, fields, public_accessors, public_mutators, public_fields
|
||||
environment, interface, definition_helper = {}, {}, setmetatable({}, definition_helper_mt)
|
||||
accessors = { private=function() _access[definition_helper] = PRIVATE; return definition_helper end, public=function() _access[definition_helper] = PUBLIC; return definition_helper end }
|
||||
mutators = setmetatable({ _=nop }, { __index=function(_, k) return function(v) _G[k] = v end end })
|
||||
fields = setmetatable(
|
||||
{ _M=environment, _G=_G, require=require, include=function(interface) include(module, interface) end, error=error, nop=nop, id=id },
|
||||
{ _M=environment, _G=_G, require=require, include=function(interface) include(P, interface) end, error=error, nop=nop, id=id },
|
||||
{ __index=function(_, k) local accessor = accessors[k]; if accessor then return accessor() else return _G[k] end end }
|
||||
)
|
||||
public_accessors = setmetatable({}, nop_default_mt)
|
||||
@@ -62,7 +61,7 @@ function module(name)
|
||||
public_fields = setmetatable({}, { __index=function(_, k) return public_accessors[k]() end })
|
||||
setmetatable(environment, proxy_mt(fields, mutators))
|
||||
setmetatable(interface, proxy_mt(public_fields, public_mutators))
|
||||
module = {
|
||||
P = {
|
||||
defined = { _M=true, _G=true, require=true, include=true, error=true, nop=true, id=true, public=true, private=true, ['_=']=true },
|
||||
[ACCESSOR] = accessors,
|
||||
[MUTATOR] = mutators,
|
||||
@@ -71,7 +70,9 @@ function module(name)
|
||||
[PUBLIC + MUTATOR] = public_mutators,
|
||||
[PUBLIC + FIELD] = public_fields,
|
||||
}
|
||||
_module[name], _module[definition_helper] = module, module
|
||||
loaded[name] = interface
|
||||
setfenv(2, environment)
|
||||
end
|
||||
_environment[name], _interface[name] = environment, interface
|
||||
loaded[name], loaded[definition_helper] = P, P
|
||||
end
|
||||
|
||||
function module(name) if not loaded[name] then create_module(name) end setfenv(2, _environment[name]) end
|
||||
function library(name) if loaded[name] then _G.error(nil) end create_module(name) setfenv(2, _environment[name]) end
|
||||
@@ -1,4 +1,4 @@
|
||||
module 'aux.auctions_tab.frame'
|
||||
module 'aux.tabs.auctions.frame'
|
||||
|
||||
local gui = require 'aux.gui'
|
||||
local auction_listing = require 'aux.gui.auction_listing'
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
module'aux.bids_tab.frame'
|
||||
module 'aux.tabs.bids.frame'
|
||||
|
||||
local gui = require 'aux.gui'
|
||||
local auction_listing = require 'aux.gui.auction_listing'
|
||||
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
module'aux.post_tab'
|
||||
module 'aux.tabs.post'
|
||||
|
||||
include'green_t'
|
||||
include'aux'
|
||||
include'aux.util'
|
||||
include'aux.control'
|
||||
include'aux.util.color'
|
||||
include 'green_t'
|
||||
include 'aux'
|
||||
include 'aux.util'
|
||||
include 'aux.control'
|
||||
include 'aux.util.color'
|
||||
|
||||
local info = require 'aux.util.info'
|
||||
local sort_util = require 'aux.util.sort'
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
module'aux.post_tab.frame'
|
||||
module'aux.tabs.post.frame'
|
||||
|
||||
local info = require 'aux.util.info'
|
||||
local money = require 'aux.util.money'
|
||||
|
||||
+17
-21
@@ -1,10 +1,10 @@
|
||||
aux_search_tab = module
|
||||
module 'aux.tabs.search'
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
include 'green_t'
|
||||
include 'aux'
|
||||
include 'aux.util'
|
||||
include 'aux.control'
|
||||
include 'aux.util.color'
|
||||
|
||||
TAB 'Search'
|
||||
|
||||
@@ -26,23 +26,23 @@ StaticPopupDialogs.AUX_SEARCH_AUTO_BUY = {
|
||||
hideOnEscape = 1,
|
||||
}
|
||||
|
||||
public.RESULTS = 1
|
||||
public.SAVED = 2
|
||||
public.FILTER = 3
|
||||
private.RESULTS = 1
|
||||
private.SAVED = 2
|
||||
private.FILTER = 3
|
||||
|
||||
function LOAD()
|
||||
aux_search_tab_frame.create()
|
||||
-- aux_search_tab_frame.create()
|
||||
subtab = SAVED
|
||||
end
|
||||
|
||||
function OPEN()
|
||||
frame:Show()
|
||||
aux_search_tab_saved.update_search_listings()
|
||||
update_search_listings()
|
||||
end
|
||||
|
||||
function CLOSE()
|
||||
aux_search_tab_results.close_settings()
|
||||
aux_search_tab_results.current_search.table:SetSelectedRecord()
|
||||
close_settings()
|
||||
current_search.table:SetSelectedRecord()
|
||||
frame:Hide()
|
||||
end
|
||||
|
||||
@@ -56,11 +56,7 @@ function USE_ITEM(item_info)
|
||||
execute(nil, false)
|
||||
end
|
||||
|
||||
function public.execute(resume, real_time)
|
||||
aux_search_tab_results.execute(resume, real_time)
|
||||
end
|
||||
|
||||
function public.subtab.set(tab)
|
||||
function private.subtab.set(tab)
|
||||
search_results_button:UnlockHighlight()
|
||||
saved_searches_button:UnlockHighlight()
|
||||
new_filter_button:UnlockHighlight()
|
||||
@@ -80,11 +76,11 @@ function public.subtab.set(tab)
|
||||
end
|
||||
end
|
||||
|
||||
function public.set_filter(filter_string)
|
||||
function private.set_filter(filter_string)
|
||||
search_box:SetText(filter_string)
|
||||
end
|
||||
|
||||
function public.add_filter(filter_string)
|
||||
function private.add_filter(filter_string)
|
||||
local old_filter_string = search_box:GetText()
|
||||
old_filter_string = trim(old_filter_string)
|
||||
|
||||
@@ -95,7 +91,7 @@ function public.add_filter(filter_string)
|
||||
search_box:SetText(old_filter_string .. filter_string)
|
||||
end
|
||||
|
||||
function public.blizzard_page_index(str)
|
||||
function private.blizzard_page_index(str)
|
||||
if tonumber(str) then
|
||||
return max(0, tonumber(str) - 1)
|
||||
end
|
||||
|
||||
+30
-37
@@ -1,23 +1,16 @@
|
||||
aux_search_tab_filter = module
|
||||
module 'aux.tabs.search'
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
local info = require 'aux.util.info'
|
||||
local money = require 'aux.util.money'
|
||||
local cache = require 'aux.core.cache'
|
||||
local filter_util = require 'aux.util.filter'
|
||||
|
||||
function LOAD()
|
||||
include (aux_search_tab)
|
||||
end
|
||||
|
||||
local filter_util = aux_filter_util
|
||||
|
||||
function public.valid_level(str)
|
||||
function private.valid_level(str)
|
||||
local level = tonumber(str)
|
||||
return level and bounded(1, 60, level)
|
||||
end
|
||||
|
||||
public.blizzard_query = setmetatable(t, {
|
||||
private.blizzard_query = setmetatable(t, {
|
||||
__index = function(_, key)
|
||||
if key == 'name' then
|
||||
return name_input:GetText()
|
||||
@@ -30,16 +23,16 @@ public.blizzard_query = setmetatable(t, {
|
||||
elseif key == 'usable' then
|
||||
return usable_checkbox:GetChecked()
|
||||
elseif key == 'class' then
|
||||
local class_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.class_dropdown)
|
||||
local class_index = UIDropDownMenu_GetSelectedValue(class_dropdown)
|
||||
return (class_index or 0) > 0 and class_index or nil
|
||||
elseif key == 'subclass' then
|
||||
local subclass_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.subclass_dropdown)
|
||||
local subclass_index = UIDropDownMenu_GetSelectedValue(subclass_dropdown)
|
||||
return (subclass_index or 0) > 0 and subclass_index or nil
|
||||
elseif key == 'slot' then
|
||||
local slot_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.slot_dropdown)
|
||||
local slot_index = UIDropDownMenu_GetSelectedValue(slot_dropdown)
|
||||
return (slot_index or 0) > 0 and slot_index or nil
|
||||
elseif key == 'quality' then
|
||||
local quality_code = UIDropDownMenu_GetSelectedValue(aux_search_tab.quality_dropdown)
|
||||
local quality_code = UIDropDownMenu_GetSelectedValue(quality_dropdown)
|
||||
return (quality_code or -1) >= 0 and quality_code or nil
|
||||
end
|
||||
end,
|
||||
@@ -70,7 +63,7 @@ public.blizzard_query = setmetatable(t, {
|
||||
end,
|
||||
})
|
||||
|
||||
function public.update_form()
|
||||
function private.update_form()
|
||||
if blizzard_query.class and GetAuctionItemSubClasses(blizzard_query.class) then
|
||||
subclass_dropdown.button:Enable()
|
||||
else
|
||||
@@ -186,19 +179,19 @@ function private.clear_form()
|
||||
update_filter_display()
|
||||
end
|
||||
|
||||
function public.import_filter_string()
|
||||
function private.import_filter_string()
|
||||
local filter, error = filter_util.parse_filter_string(select(3, strfind(search_box:GetText(), '^([^;]*)')))
|
||||
if filter or print(error) then
|
||||
set_form(filter)
|
||||
end
|
||||
end
|
||||
|
||||
function public.export_filter_string()
|
||||
function private.export_filter_string()
|
||||
search_box:SetText(get_filter_builder_query())
|
||||
filter_parameter_input:ClearFocus()
|
||||
end
|
||||
|
||||
function public.formatted_post_filter(components)
|
||||
function private.formatted_post_filter(components)
|
||||
local no_line_break
|
||||
local stack = tt
|
||||
local str = ''
|
||||
@@ -208,7 +201,7 @@ function public.formatted_post_filter(components)
|
||||
str = str .. ' '
|
||||
elseif i > 1 then
|
||||
str = str .. '</p><p>'
|
||||
for _=1,getn(stack) do
|
||||
for _ = 1, getn(stack) do
|
||||
str = str .. color.content.background('----')
|
||||
end
|
||||
end
|
||||
@@ -222,9 +215,9 @@ function public.formatted_post_filter(components)
|
||||
elseif component[1] == 'filter' then
|
||||
for parameter in present(component[3]) do
|
||||
if component[2] == 'item' then
|
||||
parameter = aux_info.display_name(aux_cache.item_id(parameter)) or '[' .. parameter .. ']'
|
||||
parameter = info.display_name(cache.item_id(parameter)) or '[' .. parameter .. ']'
|
||||
elseif filter_util.filters[component[2]].input_type == 'money' then
|
||||
parameter = aux_money.to_string(aux_money.from_string(parameter), nil, true)
|
||||
parameter = money.to_string(money.from_string(parameter), nil, true)
|
||||
end
|
||||
component_text = component_text .. filter_color(': ') .. parameter
|
||||
end
|
||||
@@ -249,7 +242,7 @@ end
|
||||
private.post_filter = t
|
||||
private.filter_builder_state = T('selected', 0)
|
||||
|
||||
function public.data_link_click()
|
||||
function private.data_link_click()
|
||||
local button = arg3
|
||||
local index = tonumber(arg1)
|
||||
if button == 'LeftButton' then
|
||||
@@ -274,7 +267,7 @@ function private.add_component(component)
|
||||
tinsert(post_filter, filter_builder_state.selected, component)
|
||||
end
|
||||
|
||||
function public.add_post_filter()
|
||||
function private.add_post_filter()
|
||||
for str in present(filter_input:GetText()) do
|
||||
for filter in present(filter_util.filters[str]) do
|
||||
if filter.input_type ~= '' then
|
||||
@@ -296,7 +289,7 @@ end
|
||||
|
||||
do
|
||||
local text = ''
|
||||
function public.update_filter_display()
|
||||
function private.update_filter_display()
|
||||
text = formatted_post_filter(post_filter)
|
||||
filter_display:SetWidth(filter_display_size())
|
||||
set_filter_display_offset()
|
||||
@@ -316,7 +309,7 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
function public.set_filter_display_offset(x_offset, y_offset)
|
||||
function private.set_filter_display_offset(x_offset, y_offset)
|
||||
local scroll_frame = filter_display:GetParent()
|
||||
x_offset, y_offset = x_offset or scroll_frame:GetHorizontalScroll(), y_offset or scroll_frame:GetVerticalScroll()
|
||||
local width, height = filter_display_size()
|
||||
@@ -328,7 +321,7 @@ function public.set_filter_display_offset(x_offset, y_offset)
|
||||
scroll_frame:SetVerticalScroll(bounded(y_lower_bound, y_upper_bound, y_offset))
|
||||
end
|
||||
|
||||
function public.initialize_filter_dropdown()
|
||||
function private.initialize_filter_dropdown()
|
||||
for filter in temp-S('and', 'or', 'not', 'min-unit-bid', 'min-unit-buy', 'max-unit-bid', 'max-unit-buy', 'bid-profit', 'buy-profit', 'bid-vend-profit', 'buy-vend-profit', 'bid-dis-profit', 'buy-dis-profit', 'bid-pct', 'buy-pct', 'item', 'tooltip', 'min-lvl', 'max-lvl', 'rarity', 'left', 'utilizable', 'discard') do
|
||||
UIDropDownMenu_AddButton(T(
|
||||
'text', filter,
|
||||
@@ -348,7 +341,7 @@ function public.initialize_filter_dropdown()
|
||||
end
|
||||
end
|
||||
|
||||
function public.initialize_class_dropdown()
|
||||
function private.initialize_class_dropdown()
|
||||
local function on_click()
|
||||
if this.value ~= blizzard_query.class then
|
||||
UIDropDownMenu_SetSelectedValue(class_dropdown, this.value)
|
||||
@@ -365,7 +358,7 @@ function public.initialize_class_dropdown()
|
||||
end
|
||||
end
|
||||
|
||||
function public.initialize_subclass_dropdown()
|
||||
function private.initialize_subclass_dropdown()
|
||||
local function on_click()
|
||||
if this.value ~= blizzard_query.subclass then
|
||||
UIDropDownMenu_SetSelectedValue(subclass_dropdown, this.value)
|
||||
@@ -374,7 +367,7 @@ function public.initialize_subclass_dropdown()
|
||||
update_form()
|
||||
end
|
||||
end
|
||||
local class_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.class_dropdown)
|
||||
local class_index = UIDropDownMenu_GetSelectedValue(class_dropdown)
|
||||
if class_index and GetAuctionItemSubClasses(class_index) then
|
||||
UIDropDownMenu_AddButton(T('text', ALL, 'value', 0, 'func', on_click))
|
||||
for i, subclass in temp-A(GetAuctionItemSubClasses(class_index)) do
|
||||
@@ -383,13 +376,13 @@ function public.initialize_subclass_dropdown()
|
||||
end
|
||||
end
|
||||
|
||||
function public.initialize_slot_dropdown()
|
||||
function private.initialize_slot_dropdown()
|
||||
local function on_click()
|
||||
UIDropDownMenu_SetSelectedValue(slot_dropdown, this.value)
|
||||
update_form()
|
||||
end
|
||||
local class_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.class_dropdown)
|
||||
local subclass_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.subclass_dropdown)
|
||||
local class_index = UIDropDownMenu_GetSelectedValue(class_dropdown)
|
||||
local subclass_index = UIDropDownMenu_GetSelectedValue(subclass_dropdown)
|
||||
if subclass_index and GetAuctionInvTypes(class_index, subclass_index) then
|
||||
UIDropDownMenu_AddButton(T('text', ALL, 'value', '', 'func', on_click))
|
||||
for i, slot in temp-A(GetAuctionInvTypes(class_index, subclass_index)) do
|
||||
@@ -398,7 +391,7 @@ function public.initialize_slot_dropdown()
|
||||
end
|
||||
end
|
||||
|
||||
function public.initialize_quality_dropdown()
|
||||
function private.initialize_quality_dropdown()
|
||||
local function on_click()
|
||||
UIDropDownMenu_SetSelectedValue(quality_dropdown, this.value)
|
||||
update_form()
|
||||
|
||||
+651
-649
File diff suppressed because it is too large
Load Diff
+24
-28
@@ -1,20 +1,16 @@
|
||||
aux_search_tab_results = module
|
||||
module 'aux.tabs.search'
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
local info = require 'aux.util.info'
|
||||
local filter_util = require 'aux.util.filter'
|
||||
local scan_util = require 'aux.util.scan'
|
||||
local scan = require 'aux.core.scan'
|
||||
|
||||
function LOAD()
|
||||
include (aux_search_tab)
|
||||
new_search('')
|
||||
new_search''
|
||||
current_search.dummy = true
|
||||
update_auto_buy_filter()
|
||||
end
|
||||
|
||||
local info, scan = aux_info, aux_scan
|
||||
|
||||
aux_auto_buy_filter = ''
|
||||
|
||||
do
|
||||
@@ -49,20 +45,20 @@ end
|
||||
|
||||
do
|
||||
local id = 0
|
||||
function public.search_scan_id.get() return id end
|
||||
function public.search_scan_id.set(v) id = v end
|
||||
function private.search_scan_id.get() return id end
|
||||
function private.search_scan_id.set(v) id = v end
|
||||
end
|
||||
do
|
||||
local validator
|
||||
function public.auto_buy_validator.get() return validator end
|
||||
function public.auto_buy_validator.set(v) validator = v end
|
||||
function private.auto_buy_validator.get() return validator end
|
||||
function private.auto_buy_validator.set(v) validator = v end
|
||||
end
|
||||
|
||||
do
|
||||
local searches = t
|
||||
local search_index = 1
|
||||
|
||||
function public.current_search.get()
|
||||
function private.current_search.get()
|
||||
return searches[search_index]
|
||||
end
|
||||
|
||||
@@ -118,20 +114,20 @@ do
|
||||
update_search(getn(searches))
|
||||
end
|
||||
|
||||
function public.previous_search()
|
||||
function private.previous_search()
|
||||
search_box:ClearFocus()
|
||||
update_search(search_index - 1)
|
||||
subtab = RESULTS
|
||||
end
|
||||
|
||||
function public.next_search()
|
||||
function private.next_search()
|
||||
search_box:ClearFocus()
|
||||
update_search(search_index + 1)
|
||||
subtab = RESULTS
|
||||
end
|
||||
end
|
||||
|
||||
function public.close_settings()
|
||||
function private.close_settings()
|
||||
if settings_button.open then
|
||||
settings_button:Click()
|
||||
end
|
||||
@@ -165,7 +161,7 @@ end
|
||||
|
||||
function private.update_auto_buy_filter()
|
||||
if aux_auto_buy_filter ~= '' then
|
||||
local queries, error = aux_filter_util.queries(aux_auto_buy_filter)
|
||||
local queries, error = filter_util.queries(aux_auto_buy_filter)
|
||||
if queries then
|
||||
if getn(queries) > 1 then
|
||||
print 'Error: The automatic buyout filter does not support multi-queries'
|
||||
@@ -232,7 +228,7 @@ function private.start_real_time_scan(query, search, continuation)
|
||||
init[new_records] = temp-values(map)
|
||||
|
||||
if getn(new_records) > 2000 then
|
||||
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
|
||||
StaticPopup_Show'AUX_SEARCH_TABLE_FULL'
|
||||
else
|
||||
search.records = new_records
|
||||
search.table:SetDatabase(search.records)
|
||||
@@ -244,7 +240,7 @@ function private.start_real_time_scan(query, search, continuation)
|
||||
end,
|
||||
on_abort = function()
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text('Scan paused')
|
||||
search.status_bar:set_text'Scan paused'
|
||||
|
||||
search.continuation = next_page or not ignore_page and query.blizzard_query.first_page or true
|
||||
|
||||
@@ -312,13 +308,13 @@ function private.start_search(queries, continuation)
|
||||
elseif getn(search.records) < 2000 then
|
||||
tinsert(search.records, auction_record)
|
||||
if getn(search.records) == 2000 then
|
||||
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
|
||||
StaticPopup_Show'AUX_SEARCH_TABLE_FULL'
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_complete = function()
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text('Scan complete')
|
||||
search.status_bar:set_text'Scan complete'
|
||||
|
||||
if current_search == search and frame.results:IsVisible() and getn(search.records) == 0 then
|
||||
subtab = SAVED
|
||||
@@ -329,7 +325,7 @@ function private.start_search(queries, continuation)
|
||||
end,
|
||||
on_abort = function()
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text('Scan paused')
|
||||
search.status_bar:set_text'Scan paused'
|
||||
|
||||
if current_query then
|
||||
search.continuation = {current_query, current_page + 1}
|
||||
@@ -359,7 +355,7 @@ function public.execute(resume, real_time)
|
||||
end
|
||||
local filter_string = search_box:GetText()
|
||||
|
||||
local queries, error = aux_filter_util.queries(filter_string)
|
||||
local queries, error = filter_util.queries(filter_string)
|
||||
if not queries then
|
||||
print('Invalid filter:', error)
|
||||
return
|
||||
@@ -385,7 +381,7 @@ function public.execute(resume, real_time)
|
||||
else
|
||||
new_search(filter_string)
|
||||
end
|
||||
aux_search_tab_saved.new_recent_search(filter_string, join(map(copy(queries), function(filter) return filter.prettified end), ';'))
|
||||
new_recent_search(filter_string, join(map(copy(queries), function(filter) return filter.prettified end), ';'))
|
||||
else
|
||||
current_search.records = t
|
||||
current_search.table:SetDatabase(current_search.records)
|
||||
@@ -428,7 +424,7 @@ do
|
||||
local state = IDLE
|
||||
local found_index
|
||||
|
||||
function public.find_auction(record)
|
||||
function private.find_auction(record)
|
||||
local search = current_search
|
||||
|
||||
if not search.table:ContainsRecord(record) or is_player(record.owner) then
|
||||
@@ -437,7 +433,7 @@ do
|
||||
|
||||
scan.abort(scan_id)
|
||||
state = SEARCHING
|
||||
scan_id = aux_scan_util.find(
|
||||
scan_id = scan_util.find(
|
||||
record,
|
||||
current_search.status_bar,
|
||||
function()
|
||||
|
||||
+3
-13
@@ -1,19 +1,9 @@
|
||||
aux_search_tab_saved = module
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
function LOAD()
|
||||
include (aux_search_tab)
|
||||
end
|
||||
module 'aux.tabs.search'
|
||||
|
||||
aux_favorite_searches = t
|
||||
aux_recent_searches = t
|
||||
|
||||
function public.update_search_listings()
|
||||
function private.update_search_listings()
|
||||
local favorite_search_rows = t
|
||||
for i, favorite_search in aux_favorite_searches do
|
||||
local name = strsub(favorite_search.prettified, 1, 250)
|
||||
@@ -37,7 +27,7 @@ function public.update_search_listings()
|
||||
recent_searches_listing:SetData(recent_search_rows)
|
||||
end
|
||||
|
||||
function public.new_recent_search(filter_string, prettified)
|
||||
function private.new_recent_search(filter_string, prettified)
|
||||
tinsert(aux_recent_searches, 1, {
|
||||
filter_string = filter_string,
|
||||
prettified = prettified,
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
module 'aux.util'
|
||||
|
||||
include 'green_t'
|
||||
include 'aux'
|
||||
module 'aux'
|
||||
|
||||
do
|
||||
local classes, interfaces, objects = {}, {}, setmetatable({}, { __mode='k' })
|
||||
Reference in New Issue
Block a user