Chess: Make the resign button have no effect after the game ends

This commit is contained in:
Tim Ledbetter 2023-05-20 23:10:05 +01:00 committed by Jelle Raaijmakers
commit b7f4363791
Notes: sideshowbarker 2024-07-17 03:51:15 +09:00

View file

@ -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;