
.namespace hotspotcoffre

function OnActivate()
	
	OPLog.Log("onactivate "..self.Name)	
	
	for i=1,16  do
		if self.Name == "hotspotcase"..tostring(i) then
			
			if selec == 1 then
			numcase2=i
			selec=2
			OPLog.Log("selec"..selec)
			end
	   
			if selec == 0 then
			--crée la surbrillance de la case séléctionné
			ut = OPUnitFactory.GetUnit("case"..tostring(i))
			contour.Position_X = ut.Position_X
			contour.Position_Y = ut.Position_Y
			contour.Flags_Visible = true
				
			--montre les cases que l'on peut cliquer
			contour2.Position_X = (ut.Position_X - 147 )
			contour2.Position_Y = (ut.Position_Y )
				if contour2.Position_X > (case1.Position_X - 147)  then
				contour2.Flags_Visible = true
				end
			contour3.Position_X = (ut.Position_X + 147 )
			contour3.Position_Y = (ut.Position_Y )
				if contour3.Position_X < (case16.Position_X + 147)   then
				contour3.Flags_Visible = true
				end
			contour4.Position_X = (ut.Position_X )
			contour4.Position_Y = (ut.Position_Y + 147 )
				if contour4.Position_Y < (case16.Position_Y + 147) then
				contour4.Flags_Visible = true
				end
			contour5.Position_X = (ut.Position_X )
			contour5.Position_Y = (ut.Position_Y - 147 )
				if contour5.Position_Y > (case1.Position_Y - 147) then
				contour5.Flags_Visible = true
				end
				
			
			numcase1=i
			selec=1
			OPLog.Log("selec"..selec)
			end
		
		end
	
	end
	
	
	
	
	
end



function OnEnable()
	AreaHotspot.OnEnable()
	
end

function GetSpecificCursor()
	return CURSOR_AREA_HOTSPOT
end

function PrivateCanClickOn()
	return true
end

