Compare commits
No commits in common. "7605646b80107b5da9272c86cffef0d29f486976" and "864ca20e18ef014ac9e71f5ed7faad9db636e839" have entirely different histories.
7605646b80
...
864ca20e18
|
@ -80,27 +80,13 @@ public class BoardDisplay extends JPanel {
|
|||
// }
|
||||
// });
|
||||
field.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
if (currentShip != null) {
|
||||
previewShipPlacement(x, y, horizontal);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
if (currentShip != null) {
|
||||
clearPreview();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (SwingUtilities.isRightMouseButton(e)) {
|
||||
togglePlacementDirection();
|
||||
togglePlacementDirection(); // Ausrichtung ändern
|
||||
} else if (SwingUtilities.isLeftMouseButton(e)) {
|
||||
Point o = new Point(x, y);
|
||||
currentShip.setHorizontal(horizontal);
|
||||
handleFieldClick(o); // Linksklick -> Schiff platzieren
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -195,7 +181,6 @@ public class BoardDisplay extends JPanel {
|
|||
|
||||
}
|
||||
|
||||
|
||||
public void refresh() {
|
||||
paintFields();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue