1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

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
parent 5a25082be5
commit b7f4363791

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;