compat: make hooksecurefunc append by default

This commit is contained in:
shagu
2025-07-30 20:18:52 +02:00
parent 37a5f1a840
commit 73561eda4a
22 changed files with 45 additions and 45 deletions
+5 -5
View File
@@ -34,9 +34,9 @@ ACTIONBAR_SECURE_TEMPLATE_BUTTON = nil
UNITFRAME_SECURE_TEMPLATE = nil
--[[ Vanilla API Extensions ]]--
function hooksecurefunc(tbl, name, func, append)
function hooksecurefunc(tbl, name, func, prepend)
if type(tbl) == "string" then
append, func, name, tbl = func, name, tbl, _G
prepend, func, name, tbl = func, name, tbl, _G
end
if not tbl or not tbl[name] then return end
@@ -45,15 +45,15 @@ function hooksecurefunc(tbl, name, func, append)
pfUI.hooks[tostring(func)]["old"] = tbl[name]
pfUI.hooks[tostring(func)]["new"] = func
if append then
if prepend then
pfUI.hooks[tostring(func)]["function"] = function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
pfUI.hooks[tostring(func)]["old"](a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
pfUI.hooks[tostring(func)]["new"](a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
pfUI.hooks[tostring(func)]["old"](a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
end
else
pfUI.hooks[tostring(func)]["function"] = function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
pfUI.hooks[tostring(func)]["new"](a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
pfUI.hooks[tostring(func)]["old"](a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
pfUI.hooks[tostring(func)]["new"](a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
end
end