local _,ns = ...

ns.ADDUIEVENT("PLAYER_LOGIN", function()

ns.tips("更换团队框架职责图标")
hooksecurefunc("CompactUnitFrame_UpdateRoleIcon",function(frame)
	if not frame.roleIcon then return end
	local role = UnitGroupRolesAssigned(frame.unit)
	if role == "TANK" then
		frame.roleIcon:SetTexture("Interface\\AddOns\\AddUI\\UI\\Textures\\ROLE-TDPS",true)
		frame.roleIcon:SetTexCoord(0.02,.28,.35,.63)
	elseif role == "HEALER" then
		frame.roleIcon:SetTexture("Interface\\AddOns\\AddUI\\UI\\Textures\\ROLE-N",true)
		frame.roleIcon:SetTexCoord(.35,.6,.05,.3)
	elseif role == "DAMAGER" then
		frame.roleIcon:SetTexture("Interface\\AddOns\\AddUI\\UI\\Textures\\ROLE-TDPS",true)
		frame.roleIcon:SetTexCoord(.35,.6,.35,.65)
	end
end)

end)

ns.tips("团队框架添加鼠标指向高亮青色边框")
local function SetMouseHighlight(frame)
	frame:HookScript("OnEnter", function(self)
		self.selectionHighlight:SetVertexColor(0,1,1)
		self.selectionHighlight:Show()
	end)
	frame:HookScript("OnLeave", function(self)
		if UnitIsUnit(self.unit,"target") then
			self.selectionHighlight:SetVertexColor(1,1,1)
		else
			self.selectionHighlight:Hide()
		end
	end)
end
for i = 1,5 do
	SetMouseHighlight(_G["CompactPartyFrameMember"..i])
end
hooksecurefunc("CompactRaidGroup_UpdateUnits",function(frame)
	for i = 1,5 do
		SetMouseHighlight(_G[frame:GetName().."Member"..i])
	end
end)