local SIZE = 95 local THROTTLE = 0.01 local OFFSET_X = 0 local OFFSET_Y = 0 local COLOR = { r = 0, g = 1, b = 0.3, a = 0.8 } local circle = CreateFrame("Frame", "MouseCombatCircle", UIParent) circle:SetSize(SIZE, SIZE) circle:SetFrameStrata("TOOLTIP") circle:Hide() local tex = circle:CreateTexture(nil, "OVERLAY") tex:SetAllPoints() tex:SetTexture("Interface\\AddOns\\nswa\\assets\\circle.png") tex:SetVertexColor(COLOR.r, COLOR.g, COLOR.b, COLOR.a) local elapsed = 0 circle:SetScript("OnUpdate", function(self, delta) elapsed = elapsed + delta if elapsed < THROTTLE then return end elapsed = 0 local x, y = GetCursorPosition() local scale = UIParent:GetScale() x = (x / scale) + OFFSET_X y = (y / scale) + OFFSET_Y self:ClearAllPoints() self:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x, y) end) local f = CreateFrame("Frame") f:RegisterEvent("PLAYER_REGEN_DISABLED") f:RegisterEvent("PLAYER_REGEN_ENABLED") f:SetScript("OnEvent", function(_, event) if event == "PLAYER_REGEN_DISABLED" then circle:Show() elseif event == "PLAYER_REGEN_ENABLED" then circle:Hide() end end)