From b7f43637916956cd49ccf5973bc044b7bfb108c9 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sat, 20 May 2023 23:10:05 +0100 Subject: [PATCH] Chess: Make the resign button have no effect after the game ends --- Userland/Games/Chess/ChessWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index b8342d37b7..5c5b977d37 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -680,6 +680,10 @@ void ChessWidget::flip_board() int ChessWidget::resign() { + // FIXME: Disable the resign checkbox if the game is finished + if (board().game_finished()) + return -1; + if (want_engine_move()) { GUI::MessageBox::show(window(), "You can only resign on your turn."sv, "Resign"sv, GUI::MessageBox::Type::Information); return -1;