[gnome-chess] Make it really obvious when an en passant capture is performed



commit 384ebe0120dfc5b786523ba7d3d125bdbe69547b
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue Apr 24 11:45:57 2018 -0500

    Make it really obvious when an en passant capture is performed
    
    Let's change the window title. Should hopefully cut down on bug reports.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=485246

 src/gnome-chess.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 12d40c5..40ba64a 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1210,6 +1210,14 @@ Copyright © 2015–2016 Sahil Sareen""";
                 /* Window title on a Black human's turn if he is in check */
                 headerbar.set_title (_("Black is in Check"));
         }
+        else if (game.current_state.last_move != null &&
+            game.current_state.last_move.en_passant)
+        {
+            if (game.current_player.color == Color.WHITE)
+                headerbar.set_title (_("Black performed an en passant capture"));
+            else
+                headerbar.set_title (_("White performed an en passant capture"));
+        }
         else if (game.current_player.color == Color.WHITE)
         {
             if (human_player == null || human_player.color == Color.WHITE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]