Commit graph

2115 commits

Author SHA1 Message Date
Michael Catanzaro
b8a76a2639 Fix "engine error" after user resigns before engine moves
If the user has resigned, the engine doesn't know the game is over,
because we don't tell it. So if the user resigns immediately after
moving, and the engine has not moved yet, we need to ignore it when it
does.

Fixes #49
2020-12-04 18:45:53 -06:00
Michael Catanzaro
39a6a2fe86 Fix "engine error" on new game after engine moves during pause
When we replay the engine's move later, we should make sure we are still
playing the same game AND that the state of the game is still the same.
Otherwise, discard the engine's move. The user has done something to
advance the state of the game beyond what the engine knows about, so
it's totally expected that the engine's move may no longer apply.

The state of the game ought to always be the same as it was before. Add
an assert just to be sure.

Halfway fixes #49
2020-12-04 18:35:15 -06:00
Michael Catanzaro
05d7bb3a11 Prefix all custom PGN tags with X-GNOME
We will still honor the original tag name when importing, so users who
saved games with older versions of GNOME Chess won't be affected.
2020-12-04 18:14:20 -06:00
Michael Catanzaro
d8d14506ae Add warning comment about the Seven Tag Roster 2020-12-04 18:04:23 -06:00
Michael Catanzaro
fb46a6765c Fix "engine error" on stalemate
When the game is stalemated, the chess engine will declare a draw. We
then check if it can claim a draw, and if not, declare that the game has
ended due to an engine bug. Since stalemate is not a valid reason to
claim a draw -- it is a forced draw, not a claimable draw -- this means
we incorrectly claim the engine is broken.

Stalemate requires special handling.
2020-12-04 17:46:40 -06:00
Michael Catanzaro
25cba4973a Promotion type selector dialog should fit mobile screens 2020-12-04 16:51:34 -06:00
Michael Catanzaro
8e01fb40ef Rework promotion type selector dialog to not use action area
Fixes #19
2020-12-04 16:51:13 -06:00
Michael Catanzaro
48a1ae651a Avoid deprecated use of librsvg 2020-12-04 15:49:02 -06:00
Michael Catanzaro
ef1fe371bb Add translator comments for en passant captures 2020-12-04 15:44:57 -06:00
Michael Catanzaro
73a3af2e3e Reduce length of en passant capture notice
There is not much space in the header bar, so let's keep the text as
short as possible.
2020-12-04 15:43:39 -06:00
Michael Catanzaro
ba7601886f Fix minimum meson version 2020-12-04 15:25:19 -06:00
Michael Catanzaro
f7a462b1eb Update doap
It's been 3.5 years since Sahil's last commit. Thanks for helping
maintain gnome-chess, Sahil!
2020-12-04 15:10:02 -06:00
Michael Catanzaro
2345085d92 Window should be a bit narrower before entering narrow mode
I tried 400 first, but then it's no longer possible to smoothly switch
between narrow and desktop mode. 500 is a bit too big to transition into
the clunky inner headerbar, so let's try 450.
2020-12-04 14:57:00 -06:00
Michael Catanzaro
0e8090dcd1 Use inner headerbar in narrow mode
The main headerbar doesn't have enough space to show messages when the
screen is narrow. So when running in mobile mode, let's add a secondary
headerbar.
2020-12-04 14:57:00 -06:00
Michael Catanzaro
b7c10f6f4f Remove extra GtkBox
We currently have a vertical GtkBox that contains the GtkInfoBar and
then another vertical GtkBox. Only one box is needed.
2020-12-04 14:57:00 -06:00
Michael Catanzaro
ed38dbe57b Hide timers in untimed games
There's no need to show the timers at all if the game is untimed.

Fixes #39
2020-12-04 14:57:00 -06:00
Michael Catanzaro
1ac2d80a3e Make all chess engines easier on easy/normal difficulty
This is not likely to have a very strong effect, but it's the best we
can do short of writing an entirely new chess engine. The HoiChess
engine seems to be notably easier than other engines, so currently that
seems like the best choice to distribute with GNOME Chess.

Fixes #18, at least sort of.
2020-12-04 14:57:00 -06:00
Michael Catanzaro
9d76722bfb Define log domain for gnome-chess
This allows displaying gnome-chess debug messages, but not other debug
messages, by setting the environment variable
G_MESSAGES_DEBUG=gnome-chess.
2020-12-04 14:57:00 -06:00
Michael Catanzaro
9bfd236a14 Update copyright year 2020-12-04 14:57:00 -06:00
Marek Černocký
e4097abd9c Updated Czech translation 2020-11-29 11:56:06 +01:00
Piotr Drąg
60057f70e0 help: Remove duplicate logos 2020-11-07 11:48:13 +01:00
Adrien Plazas
c073af3da4 data: List compatible form-factors
This will allow the app to be available in Phosh and PureOS Store.
2020-11-04 13:54:02 +01:00
Ask Hjorth Larsen
462d8eb05d Updated Danish translation 2020-11-01 13:51:58 +01:00
Ask Hjorth Larsen
13f5a517a6 add da to LINGUAS 2020-11-01 13:51:58 +01:00
Amandeep Singh
0ab9614e13 gnome-chess currently disables undo functionality when a game has ended.
This commit keeps the undo button enabled even after end of a game.
User can now undo a move even after a checkmate or a draw.

Closes #44
2020-10-18 14:30:25 +00:00
Michael Catanzaro
7e3368f278 Avoid showing claim draw dialog before forced draw
If we've repeated the same move enough times, we display the claim draw
dialog immediately before ending the game due to the forced draw. This
is wrong: the game is already over, but the user is still prompted to
decide whether to claim draw or not! That's no good.
2020-10-15 09:30:49 -05:00
Michael Catanzaro
34b6e0dee4 threefold/fivefold repetition checks should consider only current state
Way back in 4cabc41085, I thought it was
important to allow users to claim a draw at any point in the future
after a threefold repetition. But this is not what the laws of chess
allow: it should be claimed when it happens, not at random points in the
future. At the time, that change probably made sense because we didn't
tell the user when it's possible to claim a draw, which nowadays we do
by opening a message dialog. But nowadays, it has no benefit, and a
large cost: the message dialog appears at the start of every turn,
forevermore, getting in the way and irritating the user. So let's only
show it if the current board state really is eligible for a draw.

Fixes #47
2020-10-15 09:30:01 -05:00
Michael Catanzaro
b9d02fe1fc scene: fix attempt to remove invalid source
Fixes:

0  _g_log_abort (breakpoint=1) at ../../../../Projects/glib/glib/gmessages.c:559
1  0x00007f4cae0bf45e in g_logv (log_domain=0x7f4cae122b50 "GLib", log_level=G_LOG_LEVEL_CRITICAL,
    format=0x7f4cae122fc0 "Source ID %u was not found when attempting to remove it", args=0x7ffdd5eff9b8)
    at ../../../../Projects/glib/glib/gmessages.c:1405
2  0x00007f4cae0bf54f in g_log (log_domain=0x7f4cae122b50 "GLib", log_level=G_LOG_LEVEL_CRITICAL,
    format=0x7f4cae122fc0 "Source ID %u was not found when attempting to remove it")
    at ../../../../Projects/glib/glib/gmessages.c:1447
3  0x00007f4cae0b4524 in g_source_remove (tag=2921) at ../../../../Projects/glib/glib/gmain.c:2499
4  0x000000000041958e in chess_scene_set_game (self=0x25a0150, value=0x27024e0)
    at ../../../../Projects/gnome-chess/src/chess-scene.vala:97
5  0x0000000000423db6 in chess_application_start_game (self=0x22b2320)
    at ../../../../Projects/gnome-chess/src/gnome-chess.vala:520
6  0x00000000004341f0 in chess_application_start_new_game (self=0x22b2320)
    at ../../../../Projects/gnome-chess/src/gnome-chess.vala:2464
7  0x000000000042afac in chess_application_new_game_cb (self=0x22b2320)
    at ../../../../Projects/gnome-chess/src/gnome-chess.vala:1519
2020-10-14 10:14:13 -05:00
Yosef Or Boczko
7b350a90ac Update Hebrew translation 2020-09-29 18:09:39 +00:00
Fabio Tomat
8207963d1b Update Friulian translation 2020-09-22 08:37:01 +00:00
Zander Brown
f6033cd406 Update British English translation 2020-09-19 11:46:37 +00:00
Juliano Camargo
40520a16e2 Update Portuguese translation 2020-09-14 01:53:55 +00:00
Juliano Camargo
4f2a236db8 Update Portuguese translation
(cherry picked from commit fe6f354d3ff38024fba7671a119f84fa6a5dbbd9)
2020-09-14 01:34:24 +00:00
Rūdolfs Mazurs
933dfaef59 Update Latvian translation 2020-09-12 08:48:01 +00:00
Michael Catanzaro
a6dfe62507 Prepare 3.38.0 2020-09-11 18:04:37 -05:00
Efstathios Iosifidis
87bcecca39 Update Greek translation 2020-09-11 19:21:25 +00:00
Milo Casagrande
6907d60b9a Update Italian translation 2020-09-11 12:18:05 +00:00
Seong-ho Cho
514cfaa66d Update Korean translation 2020-09-07 21:27:02 +00:00
Balázs Meskó
5a271eade2 Update Hungarian translation 2020-09-06 21:09:00 +00:00
Dušan Kazik
e114fda46d Update Slovak translation 2020-09-06 15:40:05 +00:00
Daniel Mustieles
ee1b1e0cb8 Updated Spanish translation 2020-09-04 12:53:37 +02:00
Mario Blättermann
591047f0ea Update German translation 2020-09-02 18:30:23 +00:00
Mario Blättermann
5cfd7e583d Update German translation 2020-09-02 17:22:20 +00:00
Danial Behzadi
ac2a61bb9d Update Persian translation 2020-08-31 07:06:25 +00:00
Asier Sarasua Garmendia
35190b6050 Update Basque translation 2020-08-30 08:37:32 +00:00
Thibault Martin
80a64b2a05 Update French translation 2020-08-28 10:58:47 +00:00
Rafael Fontenelle
05ca6d37ba Update Brazilian Portuguese translation 2020-08-26 13:13:05 +00:00
Enrico Nicoletto
18b4178128 Update Brazilian Portuguese translation 2020-08-26 12:04:08 +00:00
Nathan Follens
ca5a40f89f Update Dutch translation 2020-08-25 13:10:01 +00:00
Goran Vidović
0ff96e8066 Update Croatian translation 2020-08-23 18:29:27 +00:00