Project

General

Profile

Revision 500

Added by Greg Tress about 16 years ago

Added right-click detection for moving robots

View differences:

Colonet.java
570 570
	        r.destx = e.getX();
571 571
	        r.desty = e.getY();
572 572
	        
573
	        csi.sendAbsoluteMove(r.id, r.destx, r.desty);
573
	        if (csi != null)
574
	            csi.sendAbsoluteMove(r.id, r.destx, r.desty);
574 575
	        
575 576
	        return;
576 577
	    }
577 578
	    
579
	    // Right-click also means we are moving a robot
580
	    if (e.getButton() == MouseEvent.BUTTON2 || e.getButton() == MouseEvent.BUTTON3) {
581
	        if (selectedBot < 0)
582
	            return;
583
	        
584
	        RobotIcon r = robotIcons.get(selectedBot);
585
	        r.destx = e.getX();
586
	        r.desty = e.getY();
587
	        
588
	        if (csi != null)
589
	            csi.sendAbsoluteMove(r.id, r.destx, r.desty);
590
	        
591
	        return;
592
	    }
593
	    
578 594
	    // If we are setting all waypoints
579 595
	    if (setWaypoint) {
580 596
	        setWaypoint = false;

Also available in: Unified diff