cooldown: enhance detection logic

This commit is contained in:
shagu
2018-04-08 19:09:51 +02:00
parent 41e2400bcb
commit 95dafe25eb
+9 -4
View File
@@ -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