mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
cooldown: enhance detection logic
This commit is contained in:
@@ -46,19 +46,24 @@ pfUI:RegisterModule("cooldown", function ()
|
|||||||
|
|
||||||
-- hook
|
-- hook
|
||||||
hooksecurefunc("CooldownFrame_SetTimer", function(this, start, duration, enable)
|
hooksecurefunc("CooldownFrame_SetTimer", function(this, start, duration, enable)
|
||||||
local parent = this.GetParent and this:GetParent()
|
-- abort on unknown frames
|
||||||
|
if not this.pfCooldownType then
|
||||||
if not this.pfCooldownType or ( this.pfCooldownType == "NOGCD" and duration < tonumber(C.appearance.cd.threshold)) then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- realign guessed cooldown frames
|
-- realign cooldown frames
|
||||||
|
local parent = this.GetParent and this:GetParent()
|
||||||
if parent and parent:GetWidth() / 36 > 0 then
|
if parent and parent:GetWidth() / 36 > 0 then
|
||||||
this:SetScale(parent:GetWidth() / 36)
|
this:SetScale(parent:GetWidth() / 36)
|
||||||
this:SetPoint("TOPLEFT", parent, "TOPLEFT", -1, 1)
|
this:SetPoint("TOPLEFT", parent, "TOPLEFT", -1, 1)
|
||||||
this:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", 1, -1)
|
this:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", 1, -1)
|
||||||
end
|
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
|
-- print time as text on cooldown frames
|
||||||
if start > 0 and duration > 0 and enable > 0 then
|
if start > 0 and duration > 0 and enable > 0 then
|
||||||
if( not this.cd ) then
|
if( not this.cd ) then
|
||||||
|
|||||||
Reference in New Issue
Block a user