From 4263e6e292abc77c1fe306407f70a99a859fa565 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 20 Sep 2020 13:45:22 +0200 Subject: [PATCH] cooldown: hide cooldown text on hidden cooldowns --- modules/cooldown.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/cooldown.lua b/modules/cooldown.lua index 512cf2d5..1727bff6 100644 --- a/modules/cooldown.lua +++ b/modules/cooldown.lua @@ -11,6 +11,13 @@ pfUI:RegisterModule("cooldown", "vanilla:tbc", function () parent = this:GetParent() if not parent then this:Hide() end + -- avoid to set cooldowns on invalid frames + if this:GetParent() and this:GetParent():GetName() and _G[this:GetParent():GetName() .. "Cooldown"] then + if not _G[this:GetParent():GetName() .. "Cooldown"]:IsShown() then + this:Hide() + end + end + if not this.next then this.next = GetTime() + .1 end if this.next > GetTime() then return end this.next = GetTime() + .1