]> git.cworth.org Git - dvonn/commitdiff
Add visual indication of selected stack
authorCarl Worth <cworth@cworth.org>
Thu, 5 Mar 2009 09:06:58 +0000 (01:06 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 5 Mar 2009 09:06:58 +0000 (01:06 -0800)
There's already logic for selecting only stacks that belong to the
current player, and changing the current player after each move---
just no logic for doing anything with the move yet.

dvonn.c

diff --git a/dvonn.c b/dvonn.c
index d4099d9984505656984668d3a7d9c72d45c41cce..ebea5e6cab115c4f2333b49391ed6ad5437d90f6 100644 (file)
--- a/dvonn.c
+++ b/dvonn.c
@@ -287,6 +287,13 @@ on_expose_event_draw (GtkWidget            *widget,
                cairo_set_source_rgba (cr, 0.0, 0.0, 0.2, 0.1);
                break;
            }
+           if (game->has_selected &&
+               x == game->selected_x &&
+               y == game->selected_y)
+           {
+               cairo_fill_preserve (cr);
+               cairo_set_source_rgba (cr, 0.2, 0.2, 1.0, 0.4);
+           }
            cairo_fill (cr);
 
            cairo_restore (cr);