mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-22 12:10:48 +00:00
compat: allow table hooks in hooksecurefunc
This commit is contained in:
+8
-4
@@ -34,11 +34,15 @@ ACTIONBAR_SECURE_TEMPLATE_BUTTON = nil
|
|||||||
UNITFRAME_SECURE_TEMPLATE = nil
|
UNITFRAME_SECURE_TEMPLATE = nil
|
||||||
|
|
||||||
--[[ Vanilla API Extensions ]]--
|
--[[ Vanilla API Extensions ]]--
|
||||||
function hooksecurefunc(name, func, append)
|
function hooksecurefunc(tbl, name, func, append)
|
||||||
if not _G[name] then return end
|
if type(tbl) == "string" then
|
||||||
|
append, func, name, tbl = func, name, tbl, _G
|
||||||
|
end
|
||||||
|
|
||||||
|
if not tbl or not tbl[name] then return end
|
||||||
|
|
||||||
pfUI.hooks[tostring(func)] = {}
|
pfUI.hooks[tostring(func)] = {}
|
||||||
pfUI.hooks[tostring(func)]["old"] = _G[name]
|
pfUI.hooks[tostring(func)]["old"] = tbl[name]
|
||||||
pfUI.hooks[tostring(func)]["new"] = func
|
pfUI.hooks[tostring(func)]["new"] = func
|
||||||
|
|
||||||
if append then
|
if append then
|
||||||
@@ -53,7 +57,7 @@ function hooksecurefunc(name, func, append)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
_G[name] = pfUI.hooks[tostring(func)]["function"]
|
tbl[name] = pfUI.hooks[tostring(func)]["function"]
|
||||||
end
|
end
|
||||||
|
|
||||||
do -- GetItemInfo
|
do -- GetItemInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user