From 059eba3139a01d13e49c73a6bcd8d29e07b15b4d Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 25 Feb 2017 16:13:11 +0100 Subject: [PATCH] cooldown: use generic hook mechanism --- modules/cooldown.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/cooldown.lua b/modules/cooldown.lua index e4c19e06..446ac8a6 100644 --- a/modules/cooldown.lua +++ b/modules/cooldown.lua @@ -55,8 +55,7 @@ pfUI:RegisterModule("cooldown", function () end -- hook - if not pfCooldownFrame_SetTimer then pfCooldownFrame_SetTimer = CooldownFrame_SetTimer end - function CooldownFrame_SetTimer(this, start, duration, enable) + pfUI.api.Hook("CooldownFrame_SetTimer", function(this, start, duration, enable) -- break here if no this-reference is set if not this then return end @@ -78,7 +77,5 @@ pfUI:RegisterModule("cooldown", function () elseif(this.cd) then this.cd:Hide(); end - - pfCooldownFrame_SetTimer(this, start, duration, enable) - end + end) end)