mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-02 03:39:59 +00:00
api: rename to hooksecurefunc
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ end
|
||||
-- 'func' [function] function containing the custom code
|
||||
-- 'append' [bool] optional variable, used to append custom
|
||||
-- code instead of prepending it
|
||||
function pfUI.api.Hook(name, func, append)
|
||||
function pfUI.api.hooksecurefunc(name, func, append)
|
||||
if not _G[name] then return end
|
||||
|
||||
pfUI.hooks[tostring(func)] = {}
|
||||
|
||||
@@ -34,18 +34,18 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
end
|
||||
end
|
||||
|
||||
Hook("ShowBonusActionBar", function()
|
||||
hooksecurefunc("ShowBonusActionBar", function()
|
||||
if pfActionBar then pfActionBar:Hide() end
|
||||
if pfBonusBar then pfBonusBar:Show() end
|
||||
end)
|
||||
|
||||
Hook("HideBonusActionBar", function()
|
||||
hooksecurefunc("HideBonusActionBar", function()
|
||||
if pfActionBar then pfActionBar:Show() end
|
||||
if pfBonusBar then pfBonusBar:Hide() end
|
||||
end)
|
||||
|
||||
if C.bars.glowrange == "1" then
|
||||
Hook("ActionButton_OnUpdate", function(elapsed)
|
||||
hooksecurefunc("ActionButton_OnUpdate", function(elapsed)
|
||||
-- Handle range indicator
|
||||
if ( this.rangeTimer ) then
|
||||
this.rangeTimer = this.rangeTimer - elapsed
|
||||
|
||||
@@ -5,7 +5,7 @@ pfUI:RegisterModule("autoshift", function ()
|
||||
pfUI.autoshift.lastError = ""
|
||||
pfUI.autoshift.CastSpellByName = _G["CastSpellByName"]
|
||||
|
||||
Hook("CastSpell", function(spellId, spellbookTabNum)
|
||||
hooksecurefunc("CastSpell", function(spellId, spellbookTabNum)
|
||||
if pfUI.autoshift.lastError == L["stances"]['wantBattleStance'] then
|
||||
pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance'])
|
||||
elseif pfUI.autoshift.lastError == L["stances"]['wantBattleDefStance'] then
|
||||
@@ -20,7 +20,7 @@ pfUI:RegisterModule("autoshift", function ()
|
||||
pfUI.autoshift.lastError = ""
|
||||
end)
|
||||
|
||||
Hook("CastSpellByName", function(spellName, onSelf)
|
||||
hooksecurefunc("CastSpellByName", function(spellName, onSelf)
|
||||
if pfUI.autoshift.lastError == L["stances"]['wantBattleStance'] then
|
||||
pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance'])
|
||||
elseif pfUI.autoshift.lastError == L["stances"]['wantBattleDefStance'] then
|
||||
@@ -35,7 +35,7 @@ pfUI:RegisterModule("autoshift", function ()
|
||||
pfUI.autoshift.lastError = ""
|
||||
end)
|
||||
|
||||
Hook("UseAction", function(slot, checkCursor, onSelf)
|
||||
hooksecurefunc("UseAction", function(slot, checkCursor, onSelf)
|
||||
if pfUI.autoshift.lastError == L["stances"]['wantBattleStance'] then
|
||||
pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance'])
|
||||
elseif pfUI.autoshift.lastError == L["stances"]['wantBattleDefStance'] then
|
||||
|
||||
+3
-3
@@ -118,20 +118,20 @@ pfUI:RegisterModule("castbar", function ()
|
||||
end
|
||||
end
|
||||
|
||||
Hook("CastSpell", function(id, bookType)
|
||||
hooksecurefunc("CastSpell", function(id, bookType)
|
||||
local spellName = GetSpellName(id, bookType)
|
||||
if pfUI.castbar.player[spellName] then
|
||||
pfUI.castbar.player[spellName](true)
|
||||
end
|
||||
end, true)
|
||||
|
||||
Hook("CastSpellByName", function(spellName, target)
|
||||
hooksecurefunc("CastSpellByName", function(spellName, target)
|
||||
if pfUI.castbar.player[spellName] then
|
||||
pfUI.castbar.player[spellName](true)
|
||||
end
|
||||
end, true)
|
||||
|
||||
Hook("UseAction", function(slot, target, button)
|
||||
hooksecurefunc("UseAction", function(slot, target, button)
|
||||
if GetActionText(slot) or not IsCurrentAction(slot) then return end
|
||||
scanner:ClearLines()
|
||||
scanner:SetAction(slot)
|
||||
|
||||
@@ -55,7 +55,7 @@ pfUI:RegisterModule("cooldown", function ()
|
||||
end
|
||||
|
||||
-- hook
|
||||
Hook("CooldownFrame_SetTimer", function(this, start, duration, enable)
|
||||
hooksecurefunc("CooldownFrame_SetTimer", function(this, start, duration, enable)
|
||||
-- realign guessed cooldown frames
|
||||
if this:GetParent() and this:GetParent():GetWidth() / 36 > 0 then
|
||||
this:SetScale(this:GetParent():GetWidth() / 36)
|
||||
|
||||
Reference in New Issue
Block a user