This commit is contained in:
Simon Hirsig
2017-11-01 15:43:34 +01:00
parent 34d6851bc5
commit 8b254ac40f
3 changed files with 36 additions and 21 deletions
-20
View File
@@ -116,26 +116,6 @@ do
end
end
SetItemRef = T.vararg-function(arg)
if arg[3] ~= 'RightButton' or not index(get_active_tab(), 'CLICK_LINK') or not strfind(arg[1], '^item:%d+') then
return orig.SetItemRef(unpack(arg))
end
local item_info = info.item(tonumber(select(3, strfind(arg[1], '^item:(%d+)'))))
if item_info then
return get_active_tab().CLICK_LINK(item_info)
end
end
UseContainerItem = T.vararg-function(arg)
if modified() or not get_active_tab() then
return orig.UseContainerItem(unpack(arg))
end
local item_info = info.container_item(arg[1], arg[2])
if item_info and get_active_tab().USE_ITEM then
get_active_tab().USE_ITEM(item_info)
end
end
M.orig = setmetatable({[_G]=T.acquire()}, {__index=function(self, key) return self[_G][key] end})
M.hook = T.vararg-function(arg)
local name, object, handler