From b7314a767c15a2b03dd4fd7133bcd62405a88afc Mon Sep 17 00:00:00 2001 From: Spit <19otari98@gmail.com> Date: Tue, 18 Mar 2025 12:29:03 +0300 Subject: [PATCH] target-castbar: move castbar to avoid overlapping with debuffs --- mods/target-castbar.lua | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/mods/target-castbar.lua b/mods/target-castbar.lua index 0cd723b..d047981 100644 --- a/mods/target-castbar.lua +++ b/mods/target-castbar.lua @@ -112,14 +112,30 @@ module.enable = function(self) castbar.texture.icon:Hide() end - if TargetofTargetFrame and TargetofTargetFrame:IsShown() then - if not castbar.dodged then + castbar:ClearAllPoints() + castbar:SetPoint("BOTTOM", TargetFrame, "BOTTOM", -12, -4) + + local targetOfTarget = TargetofTargetFrame and TargetofTargetFrame:IsShown() + local debuff11 = TargetFrameDebuff11 and TargetFrameDebuff11:IsShown() + local debuff7 = TargetFrameDebuff7 and TargetFrameDebuff7:IsShown() + local buff1 = TargetFrameBuff1 and TargetFrameBuff1:IsShown() + + if targetOfTarget then + castbar:ClearAllPoints() + castbar:SetPoint("BOTTOM", TargetFrame, "BOTTOM", -12, -24) + if debuff11 then + castbar:ClearAllPoints() + castbar:SetPoint("BOTTOM", TargetFrame, "BOTTOM", -12, -45) + if buff1 then + castbar:ClearAllPoints() + castbar:SetPoint("BOTTOM", TargetFrame, "BOTTOM", -12, -65) + end + end + else + if debuff7 then + castbar:ClearAllPoints() castbar:SetPoint("BOTTOM", TargetFrame, "BOTTOM", -12, -24) - castbar.dodged = true end - elseif castbar.dodged then - castbar:SetPoint("BOTTOM", TargetFrame, "BOTTOM", -12, -4) - castbar.dodged = nil end else castbar:Hide()