big refactoring
This commit is contained in:
+23
-35
@@ -1,13 +1,13 @@
|
|||||||
function INIT()
|
function INIT()
|
||||||
import :_ 'aux' :_ 'util'
|
import :_ 'aux' :_ 'util'
|
||||||
function LOAD()
|
|
||||||
import :_ 'aux' :_ 'util'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module 'aux'
|
module 'aux'
|
||||||
public.version = '5.0.0'
|
public.version = '5.0.0'
|
||||||
|
|
||||||
|
public.bids_loaded = false
|
||||||
|
public.current_owner_page = nil
|
||||||
|
|
||||||
do
|
do
|
||||||
local table_pool, temporary = {}, {}
|
local table_pool, temporary = {}, {}
|
||||||
|
|
||||||
@@ -20,10 +20,10 @@ do
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
function public.wipe(t) -- like with a cloth or something
|
function public.wipe(t) -- like with a cloth or something
|
||||||
for k in t do
|
for k in t do
|
||||||
t[k] = nil
|
t[k] = nil
|
||||||
end
|
end
|
||||||
table.setn(t, 0)
|
table.setn(t, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.recycle(t)
|
function public.recycle(t)
|
||||||
@@ -54,27 +54,11 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
public.tmp = modifier(function(t)
|
public.temp = modifier(function(t)
|
||||||
temporary[t] = true
|
temporary[t] = true
|
||||||
return t
|
return t
|
||||||
end)
|
end)
|
||||||
|
|
||||||
do
|
|
||||||
local mt = {
|
|
||||||
__call=function(self, arg1, arg2)
|
|
||||||
tinsert(self, arg2 or arg1)
|
|
||||||
return self
|
|
||||||
end,
|
|
||||||
__index=function(self, key)
|
|
||||||
tinsert(self, key)
|
|
||||||
return self
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
function public.accessor.from()
|
|
||||||
return setmetatable(tt, mt)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
do
|
do
|
||||||
local mt = {__call = function(self, key) return self[key] end}
|
local mt = {__call = function(self, key) return self[key] end}
|
||||||
public.set = modifier(function(table)
|
public.set = modifier(function(table)
|
||||||
@@ -84,19 +68,26 @@ do
|
|||||||
return setmetatable(self, mt)
|
return setmetatable(self, mt)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
do
|
||||||
|
local mt = {
|
||||||
|
__call=function(self, value)
|
||||||
|
tinsert(self, value)
|
||||||
|
return self
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
function public.accessor.from()
|
||||||
|
return setmetatable(t, mt)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
public.array = modifier(function(table)
|
|
||||||
local self = t
|
|
||||||
for _, v in table do tinsert(self, v) end
|
|
||||||
recycle(table)
|
|
||||||
return self
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- TODO map
|
-- TODO map
|
||||||
end
|
end
|
||||||
|
|
||||||
local event_frame = CreateFrame 'Frame'
|
local event_frame = CreateFrame 'Frame'
|
||||||
for event in tmp-set-from . ADDON_LOADED . VARIABLES_LOADED . PLAYER_LOGIN . AUCTION_HOUSE_SHOW . AUCTION_HOUSE_CLOSED . AUCTION_BIDDER_LIST_UPDATE . AUCTION_OWNED_LIST_UPDATE do
|
for event in temp-set-from 'ADDON_LOADED' 'VARIABLES_LOADED' 'PLAYER_LOGIN' 'AUCTION_HOUSE_SHOW' 'AUCTION_HOUSE_CLOSED' 'AUCTION_BIDDER_LIST_UPDATE' 'AUCTION_OWNED_LIST_UPDATE' do
|
||||||
event_frame:RegisterEvent(event)
|
event_frame:RegisterEvent(event)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -119,9 +110,6 @@ do
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
public.bids_loaded = false
|
|
||||||
public.current_owner_page = nil
|
|
||||||
|
|
||||||
function LOAD()
|
function LOAD()
|
||||||
import :_ 'util' 'gui'
|
import :_ 'util' 'gui'
|
||||||
do
|
do
|
||||||
@@ -181,7 +169,7 @@ function public.tab(index, name)
|
|||||||
local module_env = getfenv(2)
|
local module_env = getfenv(2)
|
||||||
local tab = {name=name, env=module_env}
|
local tab = {name=name, env=module_env}
|
||||||
function module_env.public.accessor.ACTIVE() return tab == active_tab end
|
function module_env.public.accessor.ACTIVE() return tab == active_tab end
|
||||||
for handler in tmp-set-from . OPEN . CLOSE . CLICK_LINK . USE_ITEM do module_env.mutable[handler] = nil end
|
for handler in temp-set-from 'OPEN' 'CLOSE' 'CLICK_LINK' 'USE_ITEM' do module_env.mutable[handler] = nil end
|
||||||
tabs[index] = tab
|
tabs[index] = tab
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
|
|||||||
+3
-5
@@ -1,5 +1,6 @@
|
|||||||
## Interface: 11200
|
## Interface: 11200
|
||||||
## Title: aux
|
## Title: aux
|
||||||
|
## Title: Auction House AddOn
|
||||||
## SavedVariablesPerCharacter: aux_auto_buy_filter, aux_tooltip_value, aux_tooltip_daily, aux_tooltip_vendor_buy, aux_tooltip_vendor_sell, aux_tooltip_disenchant_value, aux_tooltip_disenchant_distribution, aux_tooltip_disenchant_source
|
## SavedVariablesPerCharacter: aux_auto_buy_filter, aux_tooltip_value, aux_tooltip_daily, aux_tooltip_vendor_buy, aux_tooltip_vendor_sell, aux_tooltip_disenchant_value, aux_tooltip_disenchant_distribution, aux_tooltip_disenchant_source
|
||||||
## SavedVariables: aux_datasets, aux_items, aux_item_ids, aux_auctionable_items, aux_merchant_buy, aux_merchant_sell, aux_characters, aux_recent_searches, aux_favorite_searches, aux_ignore_owner, aux_price_per_unit
|
## SavedVariables: aux_datasets, aux_items, aux_item_ids, aux_auctionable_items, aux_merchant_buy, aux_merchant_sell, aux_characters, aux_recent_searches, aux_favorite_searches, aux_ignore_owner, aux_price_per_unit
|
||||||
|
|
||||||
@@ -7,18 +8,17 @@ module.lua
|
|||||||
aux-addon.lua
|
aux-addon.lua
|
||||||
util\core.lua
|
util\core.lua
|
||||||
control.lua
|
control.lua
|
||||||
|
util\color.lua
|
||||||
gui\core.lua
|
gui\core.lua
|
||||||
frame.lua
|
frame.lua
|
||||||
|
|
||||||
|
|
||||||
util\completion.lua
|
util\completion.lua
|
||||||
util\persistence.lua
|
util\persistence.lua
|
||||||
util\sort.lua
|
util\sort.lua
|
||||||
util\money.lua
|
util\money.lua
|
||||||
util\info.lua
|
util\info.lua
|
||||||
util\filter.lua
|
util\filter.lua
|
||||||
util\scan_util.lua
|
util\scan.lua
|
||||||
|
|
||||||
|
|
||||||
core\cache.lua
|
core\cache.lua
|
||||||
core\disenchant.lua
|
core\disenchant.lua
|
||||||
@@ -29,12 +29,10 @@ core\post.lua
|
|||||||
core\history.lua
|
core\history.lua
|
||||||
core\tooltip.lua
|
core\tooltip.lua
|
||||||
|
|
||||||
|
|
||||||
gui\listing.lua
|
gui\listing.lua
|
||||||
gui\auction_listing.lua
|
gui\auction_listing.lua
|
||||||
gui\item_listing.lua
|
gui\item_listing.lua
|
||||||
|
|
||||||
|
|
||||||
tabs\search\core.lua
|
tabs\search\core.lua
|
||||||
tabs\search\results.lua
|
tabs\search\results.lua
|
||||||
tabs\search\saved.lua
|
tabs\search\saved.lua
|
||||||
|
|||||||
Reference in New Issue
Block a user