[Aptitude-svn-commit] r3597 - in branches/aptitude-0.3/aptitude: . src/mine

Daniel Burrows dburrows@costa.debian.org
Sun Jul 3 19:12:18 UTC 2005


Author: dburrows
Date: Sun Jul  3 19:12:15 2005
New Revision: 3597

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/mine/cmine.cc
Log:
Fix the right-hand border of Minesweeper; add more ways to customize it.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sun Jul  3 19:12:15 2005
@@ -1,5 +1,10 @@
 2005-07-03  Daniel Burrows  <dburrows@debian.org>
 
+	* src/mine/cmine.cc:
+
+	  Fix the location of the right-hand border, and add some more
+	  color customization possibilities.
+
 	* src/main.cc:
 
 	  Don't complain loudly about invalid encodings; just generate

Modified: branches/aptitude-0.3/aptitude/src/mine/cmine.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/mine/cmine.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/mine/cmine.cc	Sun Jul  3 19:12:15 2005
@@ -707,7 +707,10 @@
 	      if(entry.adjacent_mines==0)
 		ch=L'.';
 	      else
-		ch=(L'0'+entry.adjacent_mines);
+		{
+		  ch=(L'0'+entry.adjacent_mines);
+		  cur_st=get_style("MineNumber");
+		}
 	    }
 	  else
 	    ch=L' ';
@@ -751,6 +754,8 @@
 
       if(board)
 	{
+	  apply_style(st+get_style("MineBorder"));
+
 	  int right=basex+board->get_width()+1, down=basey+1+board->get_height()+1;
 	  // x and y coordinates, respectively, of the right and lower
 	  // board edges.
@@ -827,7 +832,7 @@
 
 	      for(int y=line_start_y;
 		  y-line_start_y < vert_line_height; ++y)
-		mvadd_wch(y, 0, MINE_VLINE);
+		mvadd_wch(y, right, MINE_VLINE);
 
 	      if(down<height-1)
 		mvadd_wch(down, right, MINE_LRCORNER);
@@ -858,6 +863,8 @@
   set_style("MineFlag", style_fg(COLOR_RED)+style_attrs_on(A_BOLD));
   set_style("MineBomb", style_fg(COLOR_RED)+style_attrs_on(A_BOLD));
   set_style("MineDetonated", style_fg(COLOR_CYAN));
+  set_style("MineNumber", style_attrs_on(A_BOLD));
+  set_style("MineBorder", style_attrs_on(A_BOLD));
 
   global_bindings.set("MineUncoverSweepSquare", key(KEY_ENTER, true));
   global_bindings.set("MineFlagSquare", key(L'f', false));




More information about the Aptitude-svn-commit mailing list