[gnome-chess] Specify the player who lost in game over subtitles
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] Specify the player who lost in game over subtitles
- Date: Tue, 7 Jan 2014 16:52:19 +0000 (UTC)
commit 6954d088a13371fbeac933c16f8aec477fd5678e
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Jan 7 10:27:02 2014 -0600
Specify the player who lost in game over subtitles
A minor thing, since the winner is always mentioned in the title
anyway....
src/gnome-chess.vala | 32 +++++++++++++++++++++-----------
1 files changed, 21 insertions(+), 11 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index f8d9afd..c6e0e0b 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1105,8 +1105,14 @@ public class Application : Gtk.Application
switch (game.rule)
{
case ChessRule.CHECKMATE:
- /* Window subtitle when the game ends due to a player being checkmated */
- reason = _("Opponent is in check and cannot move (checkmate).");
+ if (game.result == ChessResult.WHITE_WON)
+ /* Window subtitle when Black is checkmated */
+ reason = _("Black is in check and cannot move (checkmate).");
+ else if (game.result == ChessResult.BLACK_WON)
+ /* Window subtitle when White is checkmated */
+ reason = _("Black is in check and cannot move (checkmate).");
+ else
+ assert_not_reached ();
break;
case ChessRule.STALEMATE:
/* Window subtitle when the game terminates due to a stalemate */
@@ -1117,8 +1123,14 @@ public class Application : Gtk.Application
reason = _("No piece has been taken or pawn moved in the last fifty moves.");
break;
case ChessRule.TIMEOUT:
- /* Window subtitle when the game ends due to one player's clock stopping */
- reason = _("Opponent has run out of time.");
+ if (game.result == ChessResult.WHITE_WON)
+ /* Window subtitle when the game ends due to Black's clock stopping */
+ reason = _("Black has run out of time.");
+ else if (game.result == ChessResult.BLACK_WON)
+ /* Window subtitle when the game ends due to White's clock stopping */
+ reason = _("White has run out of time.");
+ else
+ assert_not_reached ();
break;
case ChessRule.THREE_FOLD_REPETITION:
/* Window subtitle when the game is drawn due to the three-fold-repitition rule */
@@ -1130,15 +1142,13 @@ public class Application : Gtk.Application
break;
case ChessRule.RESIGN:
if (game.result == ChessResult.WHITE_WON)
- {
/* Window subtitle when the game ends due to the black player resigning */
- reason = _("The black player has resigned.");
- }
- else
- {
+ reason = _("Black has resigned.");
+ else if (game.result == ChessResult.BLACK_WON)
/* Window subtitle when the game ends due to the white player resigning */
- reason = _("The white player has resigned.");
- }
+ reason = _("White has resigned.");
+ else
+ assert_not_reached ();
break;
case ChessRule.ABANDONMENT:
/* Window subtitle when a game is abandoned */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]