From 05fd1587cdc19cd46eef0aab7876fddb19a8a52f Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sat, 3 Sep 2016 18:35:41 +0200 Subject: [PATCH] backup --- aux-addon.lua | 12 ++-- control.lua | 2 +- core/cache.lua | 2 +- core/disenchant.lua | 2 +- core/history.lua | 2 +- core/post.lua | 2 +- core/scan.lua | 2 +- core/slash.lua | 2 +- core/stack.lua | 2 +- core/tooltip.lua | 2 +- frame.lua | 2 +- gui/auction_listing.lua | 2 +- gui/core.lua | 2 +- gui/item_listing.lua | 2 +- gui/listing.lua | 2 +- libs/green_t.lua | 147 ++++++++++++++-------------------------- libs/module.lua | 114 ++++++++++++++----------------- tabs/auctions/core.lua | 2 +- tabs/auctions/frame.lua | 2 +- tabs/bids/core.lua | 2 +- tabs/bids/frame.lua | 2 +- tabs/post/core.lua | 2 +- tabs/post/frame.lua | 2 +- tabs/search/core.lua | 2 +- tabs/search/filter.lua | 2 +- tabs/search/frame.lua | 2 +- tabs/search/results.lua | 2 +- tabs/search/saved.lua | 2 +- util/color.lua | 2 +- util/completion.lua | 2 +- util/core.lua | 2 +- util/filter.lua | 2 +- util/info.lua | 2 +- util/money.lua | 2 +- util/persistence.lua | 2 +- util/scan.lua | 2 +- util/sort.lua | 2 +- 37 files changed, 140 insertions(+), 201 deletions(-) diff --git a/aux-addon.lua b/aux-addon.lua index 2be315a..8947cb3 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -5,10 +5,12 @@ do local modules = {} aux = function(name) if not modules[name] then - module() - modules[name] = M - import (green_t) - private.aux = setmetatable({}, {__metatable=false, __index=function(_, key) return modules[key].I end, __newindex=error}) + (function() + _ = module + modules[name] = M + import (green_t) + private.aux = setmetatable({}, {__metatable=false, __index=function(_, key) return modules[key].I end, __newindex=error}) + end)() end modules[name].import (modules.core.I) setfenv(2, modules[name]) @@ -59,7 +61,7 @@ end -- end --end -aux 'core' +aux 'core' private() public.version = '5.0.0' diff --git a/control.lua b/control.lua index 44119e9..4e62548 100644 --- a/control.lua +++ b/control.lua @@ -1,4 +1,4 @@ -aux 'core' +aux 'core' private() event_frame = CreateFrame('Frame') diff --git a/core/cache.lua b/core/cache.lua index f30f1a5..dbf83bd 100644 --- a/core/cache.lua +++ b/core/cache.lua @@ -1,4 +1,4 @@ -aux 'cache' local info, persistence = aux.info, aux.persistence +aux 'cache' private() local info, persistence = aux.info, aux.persistence MIN_ITEM_ID = 1 MAX_ITEM_ID = 30000 diff --git a/core/disenchant.lua b/core/disenchant.lua index 902903d..8bfd13b 100644 --- a/core/disenchant.lua +++ b/core/disenchant.lua @@ -1,4 +1,4 @@ -aux 'disenchant' +aux 'disenchant' private() UNCOMMON, RARE, EPIC = 2, 3, 4 diff --git a/core/history.lua b/core/history.lua index 5b3f09c..e62ea63 100644 --- a/core/history.lua +++ b/core/history.lua @@ -1,4 +1,4 @@ -aux 'history' local persistence = aux.persistence +aux 'history' private() local persistence = aux.persistence local history_schema = {'record', '#', {next_push='number'}, {daily_min_buyout='number'}, {daily_max_price='number'}, {data_points={'list', ';', {'record', '@', {market_value='number'}, {time='number'}}}} } diff --git a/core/post.lua b/core/post.lua index 5d24c89..d2a1315 100644 --- a/core/post.lua +++ b/core/post.lua @@ -1,4 +1,4 @@ -aux 'post' +aux 'post' private() local state = nil diff --git a/core/scan.lua b/core/scan.lua index ad2465d..44f931b 100644 --- a/core/scan.lua +++ b/core/scan.lua @@ -1,4 +1,4 @@ -aux 'scan' local info, history = aux.info, aux.history +aux 'scan' private() local info, history = aux.info, aux.history PAGE_SIZE = 50 diff --git a/core/slash.lua b/core/slash.lua index 472b833..1565bca 100644 --- a/core/slash.lua +++ b/core/slash.lua @@ -1,4 +1,4 @@ -aux 'slash' local persistence = aux.persistence +aux 'slash' private() local persistence = aux.persistence _G.SLASH_AUX1 = '/aux' function _G.SlashCmdList.AUX(command) diff --git a/core/stack.lua b/core/stack.lua index 6220ea1..3a8c819 100644 --- a/core/stack.lua +++ b/core/stack.lua @@ -1,4 +1,4 @@ -aux 'stack' local info = aux.info +aux 'stack' private() local info = aux.info local state diff --git a/core/tooltip.lua b/core/tooltip.lua index 91e9b4f..6c9c086 100644 --- a/core/tooltip.lua +++ b/core/tooltip.lua @@ -1,4 +1,4 @@ -aux 'tooltip' local info, disenchant, cache, money, history = aux.info, aux.disenchant, aux.cache, aux.money, aux.history +aux 'tooltip' private() local info, disenchant, cache, money, history = aux.info, aux.disenchant, aux.cache, aux.money, aux.history _G.aux_tooltip_value = true diff --git a/frame.lua b/frame.lua index 1a87b9b..668f759 100644 --- a/frame.lua +++ b/frame.lua @@ -1,4 +1,4 @@ -aux 'core' local gui = aux.gui +aux 'core' private() local gui = aux.gui function LOAD() for _, info in tab_info do tabs:create_tab(info.name) end diff --git a/gui/auction_listing.lua b/gui/auction_listing.lua index 504bf88..c032e77 100644 --- a/gui/auction_listing.lua +++ b/gui/auction_listing.lua @@ -1,4 +1,4 @@ -aux 'auction_listing' local gui, sorting, money, info = aux.gui, aux.sorting, aux.money, aux.info +aux 'auction_listing' private() local gui, sorting, money, info = aux.gui, aux.sorting, aux.money, aux.info _G.aux_price_per_unit = false diff --git a/gui/core.lua b/gui/core.lua index af252f7..cdfb661 100644 --- a/gui/core.lua +++ b/gui/core.lua @@ -1,4 +1,4 @@ -aux 'gui' +aux 'gui' private() function LOAD() do diff --git a/gui/item_listing.lua b/gui/item_listing.lua index 2341fb3..3e8c79c 100644 --- a/gui/item_listing.lua +++ b/gui/item_listing.lua @@ -1,4 +1,4 @@ -aux 'item_listing' local gui, info = aux.gui, aux.info +aux 'item_listing' private() local gui, info = aux.gui, aux.info local ROW_HEIGHT = 39 diff --git a/gui/listing.lua b/gui/listing.lua index 9b6b72b..a17815a 100644 --- a/gui/listing.lua +++ b/gui/listing.lua @@ -1,4 +1,4 @@ -aux 'listing' local gui = aux.gui +aux 'listing' private() local gui = aux.gui local ST_COUNT = 0 diff --git a/libs/green_t.lua b/libs/green_t.lua index 80f6cfe..ff67239 100644 --- a/libs/green_t.lua +++ b/libs/green_t.lua @@ -1,138 +1,91 @@ ---__.green_t = function() +green_t = module -if module 'green_t' then return end +local next, setn, type, setmetatable = next, table.setn, type, setmetatable +local wipe, recycle, table, temp_table -local wipe_chunk = [[ +local pool, pool_size, overflow_pool, tmp = {}, 0, setmetatable({}, {__mode='k'}), {} + +CreateFrame('Frame'):SetScript('OnUpdate', function() + for t in tmp do recycle(t) end; wipe(tmp) +end) + +function wipe(t) + setmetatable(t, nil); setn(t, 0) for k in t do t[k] = nil end t.reset, t.reset = nil, 1 - setn(t, 0) - setmetatable(t, nil) -]] +end +public.wipe = wipe -local recycle_chunk = wipe_chunk..[[ +function recycle(t) + wipe(t); tmp[wipe(t)] = nil if pool_size < 50 then pool_size = pool_size + 1 pool[pool_size] = t else overflow_pool[t] = true end -]] +end +public.recycle = recycle -local acquire_chunk = [[ - local t +function table() if pool_size > 0 then - t = pool[pool_size] pool_size = pool_size - 1 - else - t = next(overflow_pool) - if t then - overflow_pool[t] = nil - else - t = {} - end + return pool[pool_size + 1] end -]] + local t = next(overflow_pool) + if t then overflow_pool[t] = nil; return t end + return {} +end +public.t.get = table -pool, pool_size, overflow_pool, tmp = {}, 0, setmetatable({}, {__mode='k'}), {} +function temp_table() local t = table(); tmp[t] = true; return t end +public.tt.get = temp_table -public.empty = setmetatable({}, {__metatable=false, __newindex=nop}) - ---select(1, 2, 3, END, kek()) -- TODO -do - local f = loadstring([[ - local setmetatable, setn = setmetatable, table.setn - return function(t) - ]]..wipe_chunk..'return t end') - setfenv(f, M) - public.wipe = f() +do local mt = {__metatable=false, __newindex=error} + function public.empty.get() return setmetatable(temp_table, mt) end end -do - local f = loadstring([[ - local setmetatable, setn, pool, pool_size, overflow_pool = setmetatable, table.setn, pool, pool_size, overflow_pool - return function(t) - ]]..recycle_chunk..'end') - setfenv(f, M) - public.recycle = f() +do local f, mt + f = function(_, v) if type(v) == 'table' then tmp[v] = true end return v end + mt = {__metatable=false, __call=f, __sub=f} + public.temp {get=function() return setmetatable(temp_table(), mt) end, set=function(t) tmp[t] = true end} end - -do - local f = loadstring(format([[ - local setmetatable, setn, pool, pool_size, overflow_pool, t = setmetatable, table.setn, pool, pool_size, overflow_pool, tmp - return function() for t in t do %s end %s end - ]], recycle_chunk, wipe_chunk)) - setfenv(f, M) - CreateFrame'Frame':SetScript('OnUpdate', f()) -end - -do - local f = loadstring(format([[ - local next, pool, pool_size, overflow_pool, tmp = next, pool, pool_size, overflow_pool, tmp - return function() %s; tmp[t] = true; return t end - ]], acquire_chunk)) - setfenv(f, M) - public.tt.get = f() -end - -do local next, pool, pool_size, overflow_pool = next, pool, pool_size, overflow_pool - function public.t.get() - if pool_size > 0 then - pool_size = pool_size - 1 - return pool[pool_size + 1] - end - local t = next(overflow_pool) - if t then - overflow_pool[t] = nil - return t - end - return {} - end -end - -do local setmetatable, type, tmp = setmetatable, type, tmp - do local f, mt - f = function(_, v) if type(v) == 'table' then tmp[v] = true end return v end - mt = {__call=f, __sub=f} - public.temp {get=function() return setmetatable(tt, mt) end, set=function(t) tmp[t] = true end} - end - do local f, mt - f = function(_, v) if type(v) == 'table' then tmp[v] = nil end return v end - mt = {__call=f, __sub=f} - public.perm {get=function() return setmetatable(tt, mt) end, set=function(t) tmp[t] = nil end} - end +do local f, mt + f = function(_, v) if type(v) == 'table' then tmp[v] = nil end return v end + mt = {__metatable=false, __call=f, __sub=f} + public.perm {get=function() return setmetatable(temp_table(), mt) end, set=function(t) tmp[t] = nil end} end do local SET, ARRAY, ARRAY0, TABLE = 1, 2, 3, 4 local function insert(type) - local chunk = 'local setn, error = table.setn, error; return function(' - for i = 1, 99 do chunk = chunk..'a'..i..',' end - chunk = chunk..'overflow)'..acquire_chunk + local chunk = 'setmetatable(t, nil); local setn, error = table.setn, error; return function(t' + for i = 1, 98 do chunk = chunk..',a'..i end + chunk = chunk..',overflow)' if type == SET then - for i = 1, 99 do + for i = 1, 98 do chunk = chunk..format('if a%d == nil then return t end t[a%d] = true;', i, i) end elseif type == ARRAY then chunk = chunk..'setn(t, 99); if a1 == nil then return t end t[1] = a1;' - for i = 2, 99 do + for i = 2, 98 do chunk = chunk..format('if a%d == nil then setn(t, %d); return t end t[%d] = a%d;', i, i - 1, i, i) end elseif type == ARRAY0 then chunk = chunk..'setn(t, 99);' - for i = 1, 99 do - chunk = chunk..format('t[%d] = a%d;', i, i) - end + for i = 1, 98 do chunk = chunk..format('t[%d] = a%d;', i, i) end elseif type == TABLE then for i = 1, 97, 2 do chunk = chunk..format('if a%d == nil then return t end t[a%d] = a%d;', i, i, i + 1) end end chunk = chunk..'return overflow ~= nil and error("Overflow.") or t end' - local f = loadstring(chunk) - setfenv(f, M) - return f() + local f = loadstring(chunk); setfenv(f, M); return f() end - public(); S, A, A0, T = insert(SET), insert(ARRAY), insert(ARRAY0), insert(TABLE) -end - ---end \ No newline at end of file + local function getter(type) + local mt = {__metatable=false, __newindex=error, __call=insert(type)} + function mt:__index(t) recycle(self); return setmetatable(mt, t) end + return function() return setmetatable(t, mt) end + end + public(); S, A, A0, T = {get=getter(SET)}, {get=getter(ARRAY)}, {get=getter(ARRAY0)}, {get=getter(TABLE)} +end \ No newline at end of file diff --git a/libs/module.lua b/libs/module.lua index 8a39625..c9da810 100644 --- a/libs/module.lua +++ b/libs/module.lua @@ -1,20 +1,19 @@ if module then return end -local type, getmetatable, setmetatable, setfenv, unpack, next, _G = type, getmetatable, setmetatable, setfenv, unpack, next, getfenv(0) +local setfenv, getmetatable, setmetatable, type, unpack, next, _G = setfenv, getmetatable, setmetatable, type, unpack, next, getfenv(0) local PUBLIC, PRIVATE = 1, 2 -local CALL, INDEX, NEWINDEX = 1, 2, 3 +local FIELD, INDEX, NEWINDEX = 1, 2, 3 -do - local function print(msg) DEFAULT_CHAT_FRAME:AddMessage(RED_FONT_COLOR_CODE..msg) end - p = setmetatable({}, { +local inspect +do local function print(msg) DEFAULT_CHAT_FRAME:AddMessage(RED_FONT_COLOR_CODE..msg) end + inspect = setmetatable({}, { __call=function(_, ...) for i = 1, arg.n do - if type(arg[i]) == 'table' then - print('arg'..i..' = {') - for k, v in arg[i] do print(format(' %s: %s = %s', type(k) == 'string' and k or '['..tostring(k)..']', type(v), tostring(v))) end + print('arg'..i..' = '..(type(arg[i]) == 'string' and '"'..arg[i]..'"' or tostring(arg[i]))) + if type(arg[i]) == 'table' and next(arg[i]) then + print('{') + for k, v in arg[i] do print(' '..(type(k) == 'string' and k or '['..tostring(k)..']')..' = '..(type(v) == 'string' and '"'..v..'"' or tostring(v))) end print('}') - else - print(format('arg%d: %s = %s', i, type(arg[i]), tostring(arg[i]))) end end return unpack(arg) @@ -22,6 +21,7 @@ do __pow=function(self, v) self(v); return v end, }) end +p = inspect -- TODO local function error(msg, ...) return _G.error(format(msg or '', unpack(arg))..'\n'..debugstack(), 0) end local function import_error() error('Import error.') end @@ -29,9 +29,9 @@ local function declaration_error() error('Declaration error.') end local function collision_error(key) error('"%s" already exists.', key) end local function nil_error(key) if key then error('"%s" is nil.', key) else error('Callee is nil') end end -local nop, const = function() end, function(v) return function() return v end end +local nop = function() end -local function prototype() local eq = const(true) +local function prototype() local eq = function() return true end return setmetatable({__metatable=false, __eq=eq}, {__metatable=false, __eq=eq, __call=function(self, t) return setmetatable(t, self) end}) end @@ -40,38 +40,26 @@ local INTERFACE, ENVIRONMENT, DECLARATOR = prototype(), prototype(), prototype() local state = {} function INTERFACE:__index(key) self=state[self] - if self.access[key] == PUBLIC then - local getter = self[INDEX][key] - if getter then return getter() else return self[CALL][key] end - end + return (self.access[key] == PUBLIC or nil) and self[FIELD][key] or (self[INDEX][key] or nop)() end function INTERFACE:__newindex(key, value) self=state[self] - if self.access[key] == PUBLIC then (self[NEWINDEX][key] or nop)(value) end + return (self.access[key] == PUBLIC or nil) and (self[NEWINDEX][key] or nop)(value) end -function ENVIRONMENT:__index(key) self=state[self] - local getter = self[INDEX][key] - if getter then return getter() end - return self[CALL][key] or _G[key] or self.declarator[key] +function ENVIRONMENT:__index(key) self=state[self] local getter = self[INDEX][key] + return self[FIELD][key] or getter and getter() or not getter and (_G[key] or self.declarator[key]) end function ENVIRONMENT:__newindex(key, value) self=state[self] - if self.access[key] then - local setter = self[NEWINDEX][key] or collision_error(key) - setter(value) - else - self.declarator[key] = value - end + if self.access[key] then (self[NEWINDEX][key] or collision_error(key))(value) else self.declarator[key] = value end end +ENVIRONMENT.__call = nop -- TODO do - local ACCESS, EVENT = {public=PUBLIC, private=PRIVATE}, {call=CALL, get=INDEX, set=NEWINDEX} - local function declare(self, access, name, handlers) - self.access[name] = self.access[name] and collision_error(name) or access or self.default_access - for event, handler in handlers do - if type(handler) ~= 'function' and (event == INDEX or declaration_error()) then - handler = const(handler) - end - self[event][name] = handler + local ACCESS, EVENT = {public=PUBLIC, private=PRIVATE}, {value=FIELD, get=INDEX, set=NEWINDEX} + local function declare(self, access, name, value) + self.access[name] = (not self.access[name] or collision_error(name)) and access or self.default_access or declaration_error() + for k, v in value do + if v and (k == FIELD or type(v) == 'function') or declaration_error() then self[k][name] = v end end end function DECLARATOR:__index(key) self=state[self]; local name, access = self.declaration_name, self.declaration_access @@ -82,50 +70,46 @@ do end return self.declarator end - function DECLARATOR:__newindex(key, value) self=state[self] - local name, event = self.declaration_name, nil - if name then - event = EVENT[key] or nil_error(name) - else - name, event = key, type(value) == 'function' and CALL or INDEX - end - declare(self, self.declaration_access, name, {[event]=value}) + function DECLARATOR:__newindex(key, value) self=state[self]; local name, access = self.declaration_name, self.declaration_access + if name then declare(self, access, name, {[EVENT[key] or nil_error(name)]=value}) + elseif access or self.default_access then declare(self, access, key, {[FIELD]=value}) + else _G[key] = (not _G[key] or collision_error(key)) and value end -- G.error(nil) TODO silent error? self.declaration_access, self.declaration_name = nil, nil end function DECLARATOR:__call(v) self=state[self]; local name, access = self.declaration_name, self.declaration_access if name then if type(v) ~= 'table' or getmetatable(v) ~= nil then (access and declaration_error() or nil_error)(name) end - local f, getter, setter; f, getter, setter, v.call, v.get, v.set = v.call, v.get, v.set, nil, nil, nil - if next(v) or f ~= nil and getter ~= nil then (access and declaration_error() or nil_error)(name) end - declare(self, access, name, {[CALL]=f, [INDEX]=getter, [NEWINDEX]=setter}) - elseif access or nil_error() then - self.default_access = access - end + local value, getter, setter; value, getter, setter, v.value, v.get, v.set = v.value, v.get, v.set, nil, nil, nil + if next(v) or value ~= nil and getter ~= nil then (access and declaration_error() or nil_error)(name) end + declare(self, access, name, {[FIELD]=value, [INDEX]=getter, [NEWINDEX]=setter}) + elseif access or nil_error() then self.default_access = access end self.declaration_access, self.declaration_name = nil, nil end + DECLARATOR.__tostring = function() return 'NIL' end end local function import(self, interface) local module = (interface == INTERFACE or import_error()) and state[interface] for k, v in module.access do if v == PUBLIC and not self.access[k] then - self.access[k], self[CALL][k], self[INDEX][k], self[NEWINDEX][k] = PRIVATE, module[CALL][k], module[INDEX][k], module[NEWINDEX][k] + self.access[k], self[FIELD][k], self[INDEX][k], self[NEWINDEX][k] = PRIVATE, module[FIELD][k], module[INDEX][k], module[NEWINDEX][k] end end end -function module(name) - if name and _G[name] then return true end - local interface, env, declarator = INTERFACE {}, ENVIRONMENT {}, DECLARATOR {} - local self; self = { - access = {p=PRIVATE, _=PRIVATE, error=PRIVATE, nop=PRIVATE, _G=PRIVATE, M=PRIVATE, I=PRIVATE, public=PRIVATE, private=PRIVATE}, - [CALL] = {p=p, import=function(interface) import(self, interface) end, error=error, nop=nop}, - [INDEX] = {_G=const(_G), M=const(env), I=const(interface), public=function() return declarator.public end, private=function() return declarator.private end}, - [NEWINDEX] = {p=p, _=nop}, - declarator = declarator, - default_access = PRIVATE, - } - state[interface], state[env], state[declarator] = self, self, self - if name then _G[name] = interface end - setfenv(2, env) -end \ No newline at end of file +setmetatable(_G, { + __index = function(_, key) + if key ~= 'module' then return nil end + local interface, environment, declarator = INTERFACE {}, ENVIRONMENT {}, DECLARATOR {} + local self; self = { + access = {_G=PRIVATE, I=PRIVATE, M=PRIVATE, public=PRIVATE, private=PRIVATE, import=PRIVATE, _=PRIVATE, p=PRIVATE, error=PRIVATE, nop=PRIVATE}, + [FIELD] = {_G=_G, I=interface, M=environment, import=function(interface) import(self, interface) end, p=inspect, error=error, nop=nop}, + [INDEX] = {public=function() return declarator.public end, private=function() return declarator.private end}, + [NEWINDEX] = {p=inspect, _=nop}, + declarator = declarator, + } + state[interface], state[environment], state[declarator] = self, self, self + setfenv(2, environment) + return interface + end, +}) \ No newline at end of file diff --git a/tabs/auctions/core.lua b/tabs/auctions/core.lua index 04d2fe7..2bf47b9 100644 --- a/tabs/auctions/core.lua +++ b/tabs/auctions/core.lua @@ -1,4 +1,4 @@ -aux 'auctions_tab' local scan = aux.scan +aux 'auctions_tab' private() local scan = aux.scan auction_records = t diff --git a/tabs/auctions/frame.lua b/tabs/auctions/frame.lua index ca6a6d1..ee7b47f 100644 --- a/tabs/auctions/frame.lua +++ b/tabs/auctions/frame.lua @@ -1,4 +1,4 @@ -aux 'auctions_tab' local gui, auction_listing = aux.gui, aux.auction_listing +aux 'auctions_tab' private() local gui, auction_listing = aux.gui, aux.auction_listing function create_frames() frame = CreateFrame('Frame', nil, aux_frame) diff --git a/tabs/bids/core.lua b/tabs/bids/core.lua index 521c9e1..652e280 100644 --- a/tabs/bids/core.lua +++ b/tabs/bids/core.lua @@ -1,4 +1,4 @@ -aux 'bids_tab' local scan = aux.scan +aux 'bids_tab' private() local scan = aux.scan auction_records = t diff --git a/tabs/bids/frame.lua b/tabs/bids/frame.lua index 79c26a0..7f61609 100644 --- a/tabs/bids/frame.lua +++ b/tabs/bids/frame.lua @@ -1,4 +1,4 @@ -aux 'bids_tab' local gui, auction_listing = aux.gui, aux.auction_listing +aux 'bids_tab' private() local gui, auction_listing = aux.gui, aux.auction_listing function create_frames() frame = CreateFrame('Frame', nil, aux_frame) diff --git a/tabs/post/core.lua b/tabs/post/core.lua index abc16c8..eeb19a8 100644 --- a/tabs/post/core.lua +++ b/tabs/post/core.lua @@ -1,4 +1,4 @@ -aux 'post_tab' local scan, scan_util, history, info, persistence, item_listing, al, sorting = aux.scan, aux.scan_util, aux.history, aux.info, aux.persistence, aux.item_listing, aux.auction_listing, aux.sorting +aux 'post_tab' private() local scan, scan_util, history, info, persistence, item_listing, al, sorting = aux.scan, aux.scan_util, aux.history, aux.info, aux.persistence, aux.item_listing, aux.auction_listing, aux.sorting local DURATION_4, DURATION_8, DURATION_24 = 120, 480, 1440 diff --git a/tabs/post/frame.lua b/tabs/post/frame.lua index 56c5e90..5e07e98 100644 --- a/tabs/post/frame.lua +++ b/tabs/post/frame.lua @@ -1,4 +1,4 @@ -aux 'post_tab' local gui, listing, item_listing, money, search_tab = aux.gui, aux.listing, aux.item_listing, aux.money, aux.search_tab +aux 'post_tab' private() local gui, listing, item_listing, money, search_tab = aux.gui, aux.listing, aux.item_listing, aux.money, aux.search_tab function create_frames() frame = CreateFrame('Frame', nil, aux_frame) diff --git a/tabs/search/core.lua b/tabs/search/core.lua index 35203cc..2178624 100644 --- a/tabs/search/core.lua +++ b/tabs/search/core.lua @@ -1,4 +1,4 @@ -aux 'search_tab' local scan, scan_util = aux.scan, aux.scan_util +aux 'search_tab' private() local scan, scan_util = aux.scan, aux.scan_util StaticPopupDialogs['AUX_SEARCH_TABLE_FULL'] = { text = 'Table full!\nFurther results from this search will still be processed but no longer displayed in the table.', diff --git a/tabs/search/filter.lua b/tabs/search/filter.lua index bd11849..519852e 100644 --- a/tabs/search/filter.lua +++ b/tabs/search/filter.lua @@ -1,4 +1,4 @@ -aux 'search_tab' local filter_util = aux.filter_util +aux 'search_tab' private() local filter_util = aux.filter_util function valid_level(str) local level = tonumber(str) diff --git a/tabs/search/frame.lua b/tabs/search/frame.lua index 464fa4c..4c24147 100644 --- a/tabs/search/frame.lua +++ b/tabs/search/frame.lua @@ -1,4 +1,4 @@ -aux 'search_tab' local gui, completion, listing, auction_listing, filter_util = aux.gui, aux.completion, aux.listing, aux.auction_listing, aux.filter_util +aux 'search_tab' private() local gui, completion, listing, auction_listing, filter_util = aux.gui, aux.completion, aux.listing, aux.auction_listing, aux.filter_util FILTER_SPACING = 28.5 diff --git a/tabs/search/results.lua b/tabs/search/results.lua index d289662..e343446 100644 --- a/tabs/search/results.lua +++ b/tabs/search/results.lua @@ -1,4 +1,4 @@ -aux 'search_tab' local info, scan = aux.info, aux.scan +aux 'search_tab' private() local info, scan = aux.info, aux.scan _G.aux_auto_buy_filter = '' diff --git a/tabs/search/saved.lua b/tabs/search/saved.lua index 923256f..f891db0 100644 --- a/tabs/search/saved.lua +++ b/tabs/search/saved.lua @@ -1,4 +1,4 @@ -aux 'search_tab' +aux 'search_tab' private() _G.aux_favorite_searches = t _G.aux_recent_searches = t diff --git a/util/color.lua b/util/color.lua index c8c8a55..ae8ce9a 100644 --- a/util/color.lua +++ b/util/color.lua @@ -1,4 +1,4 @@ -aux 'core' +aux 'core' private() COLORS = { text = {enabled = {255, 254, 250, 1}, disabled = {147, 151, 139, 1}}, diff --git a/util/completion.lua b/util/completion.lua index 7bef0e1..942d2a0 100644 --- a/util/completion.lua +++ b/util/completion.lua @@ -1,4 +1,4 @@ -aux 'completion' local filter_util = aux.filter_util +aux 'completion' private() local filter_util = aux.filter_util function public:complete_filter() if IsControlKeyDown() then -- TODO problem is ctrl-v, maybe find a better solution diff --git a/util/core.lua b/util/core.lua index 3dacb6a..5ff60ef 100644 --- a/util/core.lua +++ b/util/core.lua @@ -1,4 +1,4 @@ -aux 'core' +aux 'core' private() public.join = _G.table.concat diff --git a/util/filter.lua b/util/filter.lua index cf7cb18..fa78b72 100644 --- a/util/filter.lua +++ b/util/filter.lua @@ -1,4 +1,4 @@ -aux 'filter_util' local info = aux.info +aux 'filter_util' private() local info = aux.info function default_filter(str) return { diff --git a/util/info.lua b/util/info.lua index 5abfc7b..6e21cdb 100644 --- a/util/info.lua +++ b/util/info.lua @@ -1,4 +1,4 @@ -aux 'info' +aux 'info' private() CreateFrame('GameTooltip', 'AuxTooltip', nil, 'GameTooltipTemplate') AuxTooltip:SetScript('OnTooltipAddMoney', function() diff --git a/util/money.lua b/util/money.lua index ac65c1f..0a9f050 100644 --- a/util/money.lua +++ b/util/money.lua @@ -1,4 +1,4 @@ -aux 'money' +aux 'money' private() public() GOLD_TEXT = '|cffffd70ag|r' diff --git a/util/persistence.lua b/util/persistence.lua index d2bdc9a..efd91ee 100644 --- a/util/persistence.lua +++ b/util/persistence.lua @@ -1,4 +1,4 @@ -aux 'persistence' +aux 'persistence' private() _G.aux_datasets = t diff --git a/util/scan.lua b/util/scan.lua index a4941ef..2a7a05f 100644 --- a/util/scan.lua +++ b/util/scan.lua @@ -1,4 +1,4 @@ -aux 'scan_util' local info , filter_util = aux.info, aux.filter_util +aux 'scan_util' private() local info , filter_util = aux.info, aux.filter_util function public.find(auction_record, status_bar, on_abort, on_failure, on_success) diff --git a/util/sort.lua b/util/sort.lua index ce72404..12a4d6b 100644 --- a/util/sort.lua +++ b/util/sort.lua @@ -1,4 +1,4 @@ -aux 'sorting' +aux 'sorting' private() public()