[gnome-games] glchess: Fix board orientation set to human always showing the white side



commit 739e5b02d5415f73ddcec004c1b799c97ea085e4
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Oct 9 10:09:26 2012 +1300

    glchess: Fix board orientation set to human always showing the white side
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655299

 glchess/src/chess-scene.vala |    6 +++++-
 glchess/src/glchess.vala     |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/glchess/src/chess-scene.vala b/glchess/src/chess-scene.vala
index 7507b02..6c7588d 100644
--- a/glchess/src/chess-scene.vala
+++ b/glchess/src/chess-scene.vala
@@ -65,6 +65,7 @@ public class ChessScene : Object
     private Timer animation_timer;
     private double animation_time;
 
+    public signal bool is_human (ChessPlayer player);
     public signal void changed ();
 
     public int selected_rank = -1;
@@ -154,7 +155,10 @@ public class ChessScene : Object
              case "black":
                  return 180.0;
              case "human":
-                 return 0.0; // FIXME
+                 if (is_human (game.black))
+                     return 180.0;
+                 else
+                     return 0.0;
              case "current":
                  return game.current_player.color == Color.WHITE ? 0.0 : 180.0;
              }
diff --git a/glchess/src/glchess.vala b/glchess/src/glchess.vala
index 2a2fff1..d7daad2 100644
--- a/glchess/src/glchess.vala
+++ b/glchess/src/glchess.vala
@@ -118,6 +118,7 @@ public class Application : Gtk.Application
         vbox.pack_start (info_label, true, true, 0);
 
         scene = new ChessScene ();
+        scene.is_human.connect ((p) => { return p == human_player; } );
         scene.changed.connect (scene_changed_cb);
         settings.bind ("show-move-hints", scene, "show-move-hints", SettingsBindFlags.GET);
         settings.bind ("show-numbering", scene, "show-numbering", SettingsBindFlags.GET);



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