library change

This commit is contained in:
Manuel Simon Hirsig
2016-11-08 06:07:52 +01:00
parent 18300e3d1b
commit 14a9ba3ef8
9 changed files with 86 additions and 94 deletions
+9 -12
View File
@@ -13,14 +13,12 @@ local scan = require 'aux.core.scan'
--aux_account_settings = {} -- TODO clean up the mess of savedvariables
--aux_character_settings = {}
M.version = '5.0.0'
function M.set_p(v)
inspect(nil, v)
end
function M.print(...)
auto_release(arg, true)
temp(arg)
DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE .. '[aux] ' .. join(map(arg, tostring), ' '))
end
@@ -52,7 +50,6 @@ do
for _, f in handlers do f() end
elseif event == 'PLAYER_LOGIN' then
for _, f in handlers2 do f() end
print('v' .. version .. ' loaded.')
else
_M[event]()
end
@@ -82,7 +79,7 @@ do
end
function SetItemRef(...)
auto_release(arg, true)
temp(arg)
if arg[3] ~= 'RightButton' or not index(active_tab, 'CLICK_LINK') or not strfind(arg[1], '^item:%d+') then
return orig.SetItemRef(unpack(arg))
end
@@ -92,7 +89,7 @@ function SetItemRef(...)
end
function UseContainerItem(...)
auto_release(arg, true)
temp(arg)
if modified or not index(active_tab, 'USE_ITEM') then
return orig.UseContainerItem(unpack(arg))
end
@@ -103,7 +100,7 @@ end
M.orig = setmetatable({[_G]=T}, {__index=function(self, key) return self[_G][key] end})
function M.hook(...)
auto_release(arg, true)
temp(arg)
local name, object, handler
if arg.n == 3 then
name, object, handler = unpack(arg)
@@ -200,7 +197,7 @@ end
do
local last_owner_page_requested
function GetOwnerAuctionItems(...)
auto_release(arg, true)
temp(arg)
local page = arg[1]
last_owner_page_requested = page
return orig.GetOwnerAuctionItems(unpack(arg))
@@ -214,7 +211,7 @@ function ADDON_LOADED.Blizzard_AuctionUI()
AuctionFrame:UnregisterEvent('AUCTION_HOUSE_SHOW')
AuctionFrame:SetScript('OnHide', nil)
hook('ShowUIPanel', function(...)
auto_release(arg, true)
temp(arg)
if arg[1] == AuctionFrame then return AuctionFrame:Show() end
return orig.ShowUIPanel(unpack(arg))
end)
@@ -230,7 +227,7 @@ do
end
function ADDON_LOADED.Blizzard_CraftUI()
hook('CraftFrame_SetSelection', function(...)
auto_release(arg, true)
temp(arg)
local ret = temp-A(orig.CraftFrame_SetSelection(unpack(arg)))
local id = GetCraftSelectionIndex()
local reagent_count = GetCraftNumReagents(id)
@@ -258,7 +255,7 @@ do
end
function ADDON_LOADED.Blizzard_TradeSkillUI()
hook('TradeSkillFrame_SetSelection', function(...)
auto_release(arg, true)
temp(arg)
local ret = temp-A(orig.TradeSkillFrame_SetSelection(unpack(arg)))
local id = GetTradeSkillSelectionIndex()
local reagent_count = GetTradeSkillNumReagents(id)
@@ -287,7 +284,7 @@ do
end
function AuctionFrameAuctions_OnEvent(...)
auto_release(arg, true)
temp(arg)
if AuctionFrameAuctions:IsVisible() then
return orig.AuctionFrameAuctions_OnEvent(unpack(arg))
end