local _,ns = ...
ns.ADDUIEVENT("PLAYER_LOGIN", function()
if not AddUIDB.ReportTarget then return end
if ReportTargetFrame or AddUIReportTargetFrame then return end
CompactPartyFrameTitle:Hide()
local ReportTargetFrame = CreateFrame("Button", "AddUIReportTargetFrame", CompactPartyFrame);
ReportTargetFrame:SetPoint("BOTTOMLEFT",CompactPartyFrame,"TOPLEFT", 0, -14)
ReportTargetFrame:SetSize(CompactPartyFrame:GetSize(), 20)
ReportTargetFrame:SetScript("OnClick", function(self)
	if not IsInGroup() then return end
	SendChatMessage("开始主目标检查", "PARTY")
	C_Timer.After(0.3,function()
		for i = 1,4 do
			local worker = "party"..i.."Target"
			local workername = UnitName("party"..i)
			local targetname = UnitName(worker) or "无"
			local targeticon = GetRaidTargetIndex(worker) and "{rt"..GetRaidTargetIndex(worker).."}" or ""
			if workername then
				SendChatMessage(targeticon..targetname.."←"..workername, "PARTY")
			end
		end
	end)
end)
ReportTargetFrame.Text = ReportTargetFrame:CreateFontString("AddUIReportTargetFrameText", "BACKGROUND")
ReportTargetFrame.Text:SetFont(SystemFont_Outline_Small:GetFont(), 15, "OUTLINE")
ReportTargetFrame.Text:SetPoint("BOTTOM",0,0)
ReportTargetFrame.Text:SetText("主目标检查")
ReportTargetFrame.Text:SetTextColor(0.9,0.7,0.3)

end)




