cooldown: cache parent name if existing

This commit is contained in:
shagu
2024-05-14 08:37:33 +02:00
parent 70653c7dcf
commit 0006b9c5d7
+4 -3
View File
@@ -6,14 +6,15 @@ pfUI:RegisterModule("cooldown", "vanilla:tbc", function ()
local hourcolor = {strsplit(",", C.appearance.cd.hourcolor)}
local daycolor = {strsplit(",", C.appearance.cd.daycolor)}
local parent
local parent, parent_name
local function pfCooldownOnUpdate()
parent = this:GetParent()
if not parent then this:Hide() end
parent_name = parent:GetName()
-- avoid to set cooldowns on invalid frames
if parent and parent:GetName() and _G[parent:GetName() .. "Cooldown"] then
if not _G[parent:GetName() .. "Cooldown"]:IsShown() then
if parent_name and _G[parent_name .. "Cooldown"] then
if not _G[parent_name .. "Cooldown"]:IsShown() then
this:Hide()
end
end