mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-21 23:26:56 +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
|
||||
|
||||
--[[ Vanilla API Extensions ]]--
|
||||
function hooksecurefunc(name, func, append)
|
||||
if not _G[name] then return end
|
||||
function hooksecurefunc(tbl, name, func, append)
|
||||
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)]["old"] = _G[name]
|
||||
pfUI.hooks[tostring(func)]["old"] = tbl[name]
|
||||
pfUI.hooks[tostring(func)]["new"] = func
|
||||
|
||||
if append then
|
||||
@@ -53,7 +57,7 @@ function hooksecurefunc(name, func, append)
|
||||
end
|
||||
end
|
||||
|
||||
_G[name] = pfUI.hooks[tostring(func)]["function"]
|
||||
tbl[name] = pfUI.hooks[tostring(func)]["function"]
|
||||
end
|
||||
|
||||
do -- GetItemInfo
|
||||
|
||||
Reference in New Issue
Block a user