mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 21:00:11 +01:00
developer gone
This commit is contained in:
parent
182c02cbf6
commit
85d12af878
@ -21,7 +21,7 @@ public class Board extends JPanel implements MouseListener {
|
||||
private Point selectedPiece = new Point();
|
||||
private Color moveableColor = new Color(255, 191, 0);
|
||||
public static boolean whiteToMove = true;
|
||||
public boolean developerMode = false;
|
||||
|
||||
|
||||
public Board() throws IOException {
|
||||
|
||||
@ -165,7 +165,7 @@ public class Board extends JPanel implements MouseListener {
|
||||
Piece selectedPiece = pieces[mouseCoordinateX][mouseCoordinateY];
|
||||
|
||||
// Kolla endast ifall vi kan röra på pjäsen om det är samma färg som den tur vi är på
|
||||
if (selectedPiece.isWhite() == whiteToMove || developerMode) {
|
||||
if (selectedPiece.isWhite() == whiteToMove) {
|
||||
ArrayList<Point> attacks = checkAttacks(whiteToMove);
|
||||
|
||||
ArrayList<Point> validMoves = selectedPiece.validMoves(pieces, true);
|
||||
|
@ -51,7 +51,7 @@ public class Schack {
|
||||
JMenuItem showLocalIP = new JMenuItem("Show IP");
|
||||
JMenuItem askForRemi = new JMenuItem("Ask for remi");
|
||||
JMenuItem surrender = new JMenuItem("Surrender");
|
||||
JMenuItem developerMode = new JMenuItem("Toggle Developermode");
|
||||
|
||||
|
||||
// Actions
|
||||
connectToOpponent.addActionListener((ActionEvent ae) -> {
|
||||
@ -71,9 +71,7 @@ public class Schack {
|
||||
surrender.addActionListener((ActionEvent ae) -> {
|
||||
System.out.println("I'M FRENCH! (TODO)");
|
||||
});
|
||||
developerMode.addActionListener(ae -> {
|
||||
board.developerMode = !board.developerMode;
|
||||
});
|
||||
|
||||
|
||||
// Add the menu stuff
|
||||
frame.setJMenuBar(menuBar);
|
||||
@ -83,7 +81,6 @@ public class Schack {
|
||||
connectMenu.add(showLocalIP);
|
||||
gameMenu.add(askForRemi);
|
||||
gameMenu.add(surrender);
|
||||
gameMenu.add(developerMode);
|
||||
frame.pack();
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setVisible(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user