From fdd2664c0f862e12ee0f4cc7b5cfd7379933cdef Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 23 Feb 2017 22:08:23 +0100 Subject: [PATCH] actionbar: use generic hook mechanism --- modules/actionbar.lua | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/modules/actionbar.lua b/modules/actionbar.lua index c152367f..b65e4070 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -34,32 +34,18 @@ pfUI:RegisterModule("actionbar", function () end end - if not Hook_ShowBonusActionBar then - Hook_ShowBonusActionBar = ShowBonusActionBar - end - - function ShowBonusActionBar() + pfUI.api.Hook("ShowBonusActionBar", function() if pfActionBar then pfActionBar:Hide() end if pfBonusBar then pfBonusBar:Show() end - Hook_ShowBonusActionBar() - end + end) - if not Hook_HideBonusActionBar then - Hook_HideBonusActionBar = HideBonusActionBar - end - - function HideBonusActionBar() + pfUI.api.Hook("HideBonusActionBar", function() if pfActionBar then pfActionBar:Show() end if pfBonusBar then pfBonusBar:Hide() end - Hook_HideBonusActionBar() - end + end) if pfUI_config.bars.glowrange == "1" then - if not Hook_ActionButton_OnUpdate then - Hook_ActionButton_OnUpdate = ActionButton_OnUpdate - end - - function ActionButton_OnUpdate(elapsed) + pfUI.api.Hook("ActionButton_OnUpdate", function(elapsed) -- Handle range indicator if ( this.rangeTimer ) then this.rangeTimer = this.rangeTimer - elapsed @@ -75,8 +61,7 @@ pfUI:RegisterModule("actionbar", function () this.rangeTimer = TOOLTIP_UPDATE_TIME end end - Hook_ActionButton_OnUpdate(elapsed) - end + end) end function ActionButton_GetPagedID(button)