From 95dafe25eb10186a0c31d7e53a244e4a34c49d5a Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 8 Apr 2018 19:09:51 +0200 Subject: [PATCH] cooldown: enhance detection logic --- modules/cooldown.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/cooldown.lua b/modules/cooldown.lua index 783a382a..5d62a6b8 100644 --- a/modules/cooldown.lua +++ b/modules/cooldown.lua @@ -46,19 +46,24 @@ pfUI:RegisterModule("cooldown", function () -- hook hooksecurefunc("CooldownFrame_SetTimer", function(this, start, duration, enable) - local parent = this.GetParent and this:GetParent() - - if not this.pfCooldownType or ( this.pfCooldownType == "NOGCD" and duration < tonumber(C.appearance.cd.threshold)) then + -- abort on unknown frames + if not this.pfCooldownType then return end - -- realign guessed cooldown frames + -- realign cooldown frames + local parent = this.GetParent and this:GetParent() if parent and parent:GetWidth() / 36 > 0 then this:SetScale(parent:GetWidth() / 36) this:SetPoint("TOPLEFT", parent, "TOPLEFT", -1, 1) this:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", 1, -1) end + -- don't draw global cooldowns + if this.pfCooldownType == "NOGCD" and duration < tonumber(C.appearance.cd.threshold) then + return + end + -- print time as text on cooldown frames if start > 0 and duration > 0 and enable > 0 then if( not this.cd ) then