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()