Core/Cooldowns: fix cooldown lua error
This commit is contained in:
@@ -167,7 +167,7 @@ end
|
|||||||
|
|
||||||
function E:CreateCooldownTimer(parent, displayParent)
|
function E:CreateCooldownTimer(parent, displayParent)
|
||||||
local timer = CreateFrame("Frame", parent:GetName() and parent:GetName().."Timer" or nil, displayParent)
|
local timer = CreateFrame("Frame", parent:GetName() and parent:GetName().."Timer" or nil, displayParent)
|
||||||
parent:HookScript("OnHide", function(self) if self:GetParent().isNamePlate then return end timer:Hide() end)
|
parent:HookScript("OnHide", function(self) local parent = self:GetParent() if parent and parent.isNamePlate then return end timer:Hide() end)
|
||||||
parent:HookScript("OnShow", function(self) timer:Show() end)
|
parent:HookScript("OnShow", function(self) timer:Show() end)
|
||||||
timer:SetFrameLevel(parent:GetFrameLevel() + 1)
|
timer:SetFrameLevel(parent:GetFrameLevel() + 1)
|
||||||
timer:Hide()
|
timer:Hide()
|
||||||
@@ -221,7 +221,7 @@ end
|
|||||||
function E:RegisterCooldown(cooldown, module)
|
function E:RegisterCooldown(cooldown, module)
|
||||||
if not cooldown.isHooked then
|
if not cooldown.isHooked then
|
||||||
hooksecurefunc(cooldown, "SetCooldown", E.OnSetCooldown)
|
hooksecurefunc(cooldown, "SetCooldown", E.OnSetCooldown)
|
||||||
if cooldown:GetParent().isNamePlate then
|
if cooldown:GetParent() and cooldown:GetParent().isNamePlate then
|
||||||
cooldown.Show = cooldown.Hide
|
cooldown.Show = cooldown.Hide
|
||||||
cooldown:Hide()
|
cooldown:Hide()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user