From 5f8d4f269ace5f456b5bf468ab57853cd51effa0 Mon Sep 17 00:00:00 2001 From: aelga Date: Fri, 16 May 2025 13:17:42 +0200 Subject: [PATCH] Boo --- src/windowInterface/MyInterface.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/windowInterface/MyInterface.java b/src/windowInterface/MyInterface.java index 2c21dce..9d7a0a4 100644 --- a/src/windowInterface/MyInterface.java +++ b/src/windowInterface/MyInterface.java @@ -265,7 +265,12 @@ public class MyInterface extends JFrame { /*if (game != null && game.isCheckmate(true)) { String winner = turnIsWhite ? "Black" : "White"; // since it's mate, last move won JOptionPane.showMessageDialog(this, "Checkmate! " + winner + " wins.", "Game Over", JOptionPane.INFORMATION_MESSAGE); - }*/ + game.setDefaultSetup(); // resets the board setup + turnLabel.setText("Turn : 1, White"); + actionLabel.setText("Game reset after checkmate"); + repaint(); + return; // skip repaint below as we already called it + }*/ this.repaint(); } @@ -275,6 +280,7 @@ public class MyInterface extends JFrame { } + }