Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: (PR#1328) [patch] "turns-to-grow" on the map overview
Home

[Freeciv-Dev] Re: (PR#1328) [patch] "turns-to-grow" on the map overview

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#1328) [patch] "turns-to-grow" on the map overview
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Sun, 17 Nov 2002 14:04:52 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sat, Nov 16, 2002 at 08:28:15AM -0800, Raimar Falke via RT wrote:
> On Tue, Nov 05, 2002 at 06:51:52PM -0800, Jason Short via RT wrote:
> > 
> > Attached is an update of this patch.
> > 
> > Changes:
> > - Updated for current CVS.
> > - GTK2 support.  This is lacking because it doesn't use colors the way
> > the other clients do.  I'm not familiar with Pango (yet).
> 
> IMHO this just screams for a unification in some *_common file.

And the patch. GTK and XAW is tested. GTK2 still needs convertion and
testing.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I haven't lost my mind - it's backed up on tape somewhere."

Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.86
diff -u -r1.86 control.c
--- client/control.c    2002/11/14 09:14:50     1.86
+++ client/control.c    2002/11/17 21:54:05
@@ -946,7 +946,20 @@
   draw_city_names ^= 1;
   update_map_canvas_visible();
 }
+ 
+ /**************************************************************************
+ Toggle display of city growth (turns-to-grow)
+**************************************************************************/
+void request_toggle_city_growth(void)
+{
+  if (get_client_state() != CLIENT_GAME_RUNNING_STATE) {
+    return;
+  }
 
+  draw_city_growth = !draw_city_growth;
+  update_map_canvas_visible();
+}
+
 /**************************************************************************
  Toggle display of city productions
 **************************************************************************/
@@ -1744,6 +1757,15 @@
 void key_city_names_toggle(void)
 {
   request_toggle_city_names();
+}
+
+/**************************************************************************
+  Toggles the "show city growth turns" option by passing off the
+  request to another function...
+**************************************************************************/
+void key_city_growth_toggle(void)
+{
+  request_toggle_city_growth();
 }
 
 /**************************************************************************
Index: client/control.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.h,v
retrieving revision 1.29
diff -u -r1.29 control.h
--- client/control.h    2002/11/01 17:51:12     1.29
+++ client/control.h    2002/11/17 21:54:05
@@ -66,6 +66,7 @@
 void request_unit_wakeup(struct unit *punit);
 void request_toggle_map_grid(void);
 void request_toggle_city_names(void);
+void request_toggle_city_growth(void);
 void request_toggle_city_productions(void);
 void request_toggle_terrain(void);
 void request_toggle_coastline(void);
@@ -99,6 +100,7 @@
 
 void key_cancel_action(void);
 void key_city_names_toggle(void);
+void key_city_growth_toggle(void);
 void key_city_productions_toggle(void);
 void key_terrain_toggle(void);
 void key_coastline_toggle(void);
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.13
diff -u -r1.13 mapview_common.c
--- client/mapview_common.c     2002/11/15 09:24:51     1.13
+++ client/mapview_common.c     2002/11/17 21:54:06
@@ -418,3 +418,45 @@
     need_mapview_update = FALSE;
   }
 }
+
+void get_city_mapview_name_and_growth(struct city *pcity,
+                                     char *name_buffer,
+                                     size_t name_buffer_len,
+                                     char *growth_buffer,
+                                     size_t growth_buffer_len,
+                                     enum color_std *growth_color)
+{
+  if (!draw_city_names) {
+    name_buffer[0] = '\0';
+    growth_buffer[0] = '\0';
+    *growth_color = COLOR_STD_WHITE;
+    return;
+  }
+       
+  my_snprintf(name_buffer, name_buffer_len,
+             draw_city_growth ? "%s " : "%s", pcity->name);
+
+  if (draw_city_growth && pcity->owner == game.player_idx) {
+    int turns = city_turns_to_grow(pcity);
+
+    if (turns == 0) {
+      my_snprintf(growth_buffer, growth_buffer_len, "X");
+    } else if (turns == FC_INFINITY) {
+      my_snprintf(growth_buffer, growth_buffer_len, "-");
+    } else {
+      /* Negative turns means we're shrinking, but that's handled
+         down below. */
+      my_snprintf(growth_buffer, growth_buffer_len, "%d", abs(turns));
+    }
+
+    if (turns <= 0) {
+      /* A blocked or shrinking city has its growth status shown in red. */
+      *growth_color = COLOR_STD_RED;
+    } else {
+      *growth_color = COLOR_STD_WHITE;
+    }
+  } else {
+    growth_buffer[0] = '\0';
+    *growth_color = COLOR_STD_WHITE;
+  }
+}
Index: client/mapview_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.h,v
retrieving revision 1.8
diff -u -r1.8 mapview_common.h
--- client/mapview_common.h     2002/11/15 09:24:51     1.8
+++ client/mapview_common.h     2002/11/17 21:54:06
@@ -57,6 +57,12 @@
 
 void get_city_mapview_production(struct city *pcity,
                                  char *buf, size_t buf_len);
+void get_city_mapview_name_and_growth(struct city *pcity,
+                                     char *name_buffer,
+                                     size_t name_buffer_len,
+                                     char *growth_buffer,
+                                     size_t growth_buffer_len,
+                                     enum color_std *grwoth_color);
 
 void queue_mapview_update(void);
 void unqueue_mapview_update(void);
Index: client/options.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/options.c,v
retrieving revision 1.71
diff -u -r1.71 options.c
--- client/options.c    2002/11/17 02:21:11     1.71
+++ client/options.c    2002/11/17 21:54:08
@@ -127,6 +127,7 @@
 
 bool draw_map_grid = FALSE;
 bool draw_city_names = TRUE;
+bool draw_city_growth = TRUE;
 bool draw_city_productions = FALSE;
 bool draw_terrain = TRUE;
 bool draw_coastline = FALSE;
@@ -147,6 +148,7 @@
 view_option view_options[] = {
   VIEW_OPTION(draw_map_grid),
   VIEW_OPTION(draw_city_names),
+  VIEW_OPTION(draw_city_growth),
   VIEW_OPTION(draw_city_productions),
   VIEW_OPTION(draw_terrain),
   VIEW_OPTION(draw_coastline),
Index: client/options.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/options.h,v
retrieving revision 1.24
diff -u -r1.24 options.h
--- client/options.h    2002/11/14 09:22:09     1.24
+++ client/options.h    2002/11/17 21:54:08
@@ -75,6 +75,7 @@
 
 extern bool draw_map_grid;
 extern bool draw_city_names;
+extern bool draw_city_growth;
 extern bool draw_city_productions;
 extern bool draw_terrain;
 extern bool draw_coastline;
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.261
diff -u -r1.261 packhand.c
--- client/packhand.c   2002/11/14 09:14:51     1.261
+++ client/packhand.c   2002/11/17 21:54:13
@@ -338,6 +338,12 @@
                pcity->shield_surplus != packet->shield_surplus ||
                pcity->shield_stock != packet->shield_stock)) {
       update_descriptions = TRUE;
+    } else if (draw_city_names && draw_city_growth &&
+              (pcity->food_stock != packet->food_stock ||
+               pcity->food_surplus != packet->food_surplus)) {
+      /* If either the food stock or surplus have changed, the time-to-grow
+        is likely to have changed as well. */
+      update_descriptions = TRUE;
     }
 
     /* update the descriptions if necessary */
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.131
diff -u -r1.131 mapview.c
--- client/gui-gtk/mapview.c    2002/11/17 02:21:12     1.131
+++ client/gui-gtk/mapview.c    2002/11/17 21:54:18
@@ -1307,23 +1307,37 @@
 **************************************************************************/
 static void show_desc_at_tile(int x, int y)
 {
-  static char buffer[512];
-  struct city *pcity;
-  if ((pcity = map_get_city(x, y))) {
+  static char buffer[512], buffer2[32];
+  struct city *pcity = map_get_city(x, y);
+
+  if (pcity) {
     int canvas_x, canvas_y;
-    int w, ascent;
+    int w, w2, ascent;
+    enum color_std color;
 
     get_canvas_xy(x, y, &canvas_x, &canvas_y);
-    if (draw_city_names) {
-      my_snprintf(buffer, sizeof(buffer), "%s", pcity->name);
-      gdk_string_extents(main_fontset, buffer, NULL, NULL, &w, &ascent, NULL);
-      gtk_draw_shadowed_string(map_canvas->window, main_fontset,
-                              toplevel->style->black_gc,
-                              toplevel->style->white_gc,
-                              canvas_x + NORMAL_TILE_WIDTH / 2 - w / 2,
-                              canvas_y + NORMAL_TILE_HEIGHT +
-                              ascent, buffer);
-    }
+
+    get_city_mapview_name_and_growth(pcity,buffer,sizeof(buffer),
+                                    buffer2,sizeof(buffer2),
+                                    &color);
+
+    w = gdk_string_width(main_fontset, buffer);
+    w2 = gdk_string_width(prod_fontset, buffer2);
+
+    gtk_draw_shadowed_string(map_canvas->window, main_fontset,
+                            toplevel->style->black_gc,
+                            toplevel->style->white_gc,
+                            canvas_x + NORMAL_TILE_WIDTH / 2 - (w + w2) / 2,
+                            canvas_y + NORMAL_TILE_HEIGHT +
+                            main_fontset->ascent, buffer);
+    gdk_gc_set_foreground(civ_gc, colors_standard[color]);
+    gtk_draw_shadowed_string(map_canvas->window, prod_fontset,
+                            toplevel->style->black_gc,
+                            civ_gc,
+                            canvas_x + NORMAL_TILE_WIDTH / 2
+                            - (w + w2) / 2 + w,
+                            canvas_y + NORMAL_TILE_HEIGHT
+                            + main_fontset->ascent, buffer2);
 
     if (draw_city_productions && (pcity->owner==game.player_idx)) {
       int y_offset;
Index: client/gui-gtk/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/menu.c,v
retrieving revision 1.70
diff -u -r1.70 menu.c
--- client/gui-gtk/menu.c       2002/11/14 09:14:54     1.70
+++ client/gui-gtk/menu.c       2002/11/17 21:54:20
@@ -80,6 +80,7 @@
 
   MENU_VIEW_SHOW_MAP_GRID,
   MENU_VIEW_SHOW_CITY_NAMES,
+  MENU_VIEW_SHOW_CITY_GROWTH_TURNS,
   MENU_VIEW_SHOW_CITY_PRODUCTIONS,
   MENU_VIEW_SHOW_TERRAIN,
   MENU_VIEW_SHOW_COASTLINE,
@@ -227,8 +228,14 @@
       key_map_grid_toggle();
     break;
   case MENU_VIEW_SHOW_CITY_NAMES:
-    if (draw_city_names ^ GTK_CHECK_MENU_ITEM(widget)->active)
+    if (draw_city_names ^ GTK_CHECK_MENU_ITEM(widget)->active) {
       key_city_names_toggle();
+      menus_set_sensitive("<main>/_View/City G_rowth", draw_city_names);
+    }
+    break;
+  case MENU_VIEW_SHOW_CITY_GROWTH_TURNS:
+    if (draw_city_growth ^ GTK_CHECK_MENU_ITEM(widget)->active)
+      key_city_growth_toggle();
     break;
   case MENU_VIEW_SHOW_CITY_PRODUCTIONS:
     if (draw_city_productions ^ GTK_CHECK_MENU_ITEM(widget)->active)
@@ -599,6 +606,8 @@
        view_menu_callback,     MENU_VIEW_SHOW_MAP_GRID,                
"<CheckItem>"   },
   { "/" N_("View") "/" N_("City _Names"),              "<control>n",
        view_menu_callback,     MENU_VIEW_SHOW_CITY_NAMES,              
"<CheckItem>"   },
+  { "/" N_("View") "/" N_("City G_rowth"),             "<control>r",
+       view_menu_callback,     MENU_VIEW_SHOW_CITY_GROWTH_TURNS,       
"<CheckItem>"   },
   { "/" N_("View") "/" N_("City _Productions"),                "<control>p",
        view_menu_callback,     MENU_VIEW_SHOW_CITY_PRODUCTIONS,        
"<CheckItem>"   },
   { "/" N_("View") "/sep1",                            NULL,
@@ -982,6 +991,8 @@
 
     menus_set_active("<main>/_View/Map _Grid", draw_map_grid);
     menus_set_active("<main>/_View/City _Names", draw_city_names);
+    menus_set_sensitive("<main>/_View/City G_rowth", draw_city_names);
+    menus_set_active("<main>/_View/City G_rowth", draw_city_growth);
     menus_set_active("<main>/_View/City _Productions", draw_city_productions);
     menus_set_active("<main>/_View/Terrain", draw_terrain);
     menus_set_active("<main>/_View/Coastline", draw_coastline);
Index: client/gui-gtk-2.0/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.c,v
retrieving revision 1.19
diff -u -r1.19 mapview.c
--- client/gui-gtk-2.0/mapview.c        2002/11/17 02:21:12     1.19
+++ client/gui-gtk-2.0/mapview.c        2002/11/17 21:54:26
@@ -1331,26 +1331,66 @@
 **************************************************************************/
 static void show_desc_at_tile(PangoLayout *layout, int x, int y)
 {
-  static char buffer[512];
+  static char buffer[512], buffer2[32];
   struct city *pcity;
   if ((pcity = map_get_city(x, y))) {
     int canvas_x, canvas_y;
-    PangoRectangle rect;
+    PangoRectangle rect, rect2;
 
     get_canvas_xy(x, y, &canvas_x, &canvas_y);
     if (draw_city_names) {
-      my_snprintf(buffer, sizeof(buffer), "%s", pcity->name);
+      int turns = 0;
+
+      my_snprintf(buffer, sizeof(buffer),
+                  draw_city_growth ? "%s  " : "%s", pcity->name);
       
       pango_layout_set_font_description(layout, main_font);
       pango_layout_set_text(layout, buffer, -1);
-
       pango_layout_get_pixel_extents(layout, &rect, NULL);
+
+      if (draw_city_growth && pcity->owner == game.player_idx) {
+       turns = city_turns_to_grow(pcity);
+        if (turns == 0) {
+          snprintf(buffer2, sizeof(buffer2), "X");
+        } else if (turns == FC_INFINITY) {
+          snprintf(buffer2, sizeof(buffer2), "-");
+        } else {
+          /* Negative turns means we're shrinking, but that's handled
+             down below. */
+          snprintf(buffer2, sizeof(buffer2), "%d", abs(turns));
+        }
+
+       pango_layout_set_font_description(layout, city_productions_font);
+       pango_layout_set_text(layout, buffer2, -1);
+       pango_layout_get_pixel_extents(layout, &rect2, NULL);
+      } else {
+       rect2.width = 0;
+      }
+
+      pango_layout_set_font_description(layout, main_font);
+      pango_layout_set_text(layout, buffer, -1);
       gtk_draw_shadowed_string(map_canvas->window,
                           toplevel->style->black_gc,
                           toplevel->style->white_gc,
-                          canvas_x + NORMAL_TILE_WIDTH / 2 - rect.width / 2,
+                          canvas_x + NORMAL_TILE_WIDTH / 2
+                              - (rect.width + rect2.width) / 2,
                           canvas_y + NORMAL_TILE_HEIGHT +
                           PANGO_ASCENT(rect), layout);
+
+      if (draw_city_growth && pcity->owner == game.player_idx) {
+       /* FIXME: use different color for a blocked/shrinking city. */
+       pango_layout_set_font_description(layout, city_productions_font);
+       pango_layout_set_text(layout, buffer2, -1);
+       gtk_draw_shadowed_string(map_canvas->window,
+                       toplevel->style->black_gc,
+                       toplevel->style->white_gc,
+                       canvas_x + NORMAL_TILE_WIDTH / 2
+                                - (rect.width + rect2.width) / 2
+                                + rect.width,
+                       canvas_y + NORMAL_TILE_HEIGHT +
+                       PANGO_ASCENT(rect) + rect.height / 2 - rect2.height / 
2, layout);
+
+      }
     }
 
     if (draw_city_productions && (pcity->owner==game.player_idx)) {
Index: client/gui-gtk-2.0/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/menu.c,v
retrieving revision 1.8
diff -u -r1.8 menu.c
--- client/gui-gtk-2.0/menu.c   2002/11/14 09:14:55     1.8
+++ client/gui-gtk-2.0/menu.c   2002/11/17 21:54:28
@@ -81,6 +81,7 @@
 
   MENU_VIEW_SHOW_MAP_GRID,
   MENU_VIEW_SHOW_CITY_NAMES,
+  MENU_VIEW_SHOW_CITY_GROWTH_TURNS,
   MENU_VIEW_SHOW_CITY_PRODUCTIONS,
   MENU_VIEW_SHOW_TERRAIN,
   MENU_VIEW_SHOW_COASTLINE,
@@ -228,8 +229,14 @@
       key_map_grid_toggle();
     break;
   case MENU_VIEW_SHOW_CITY_NAMES:
-    if (draw_city_names ^ GTK_CHECK_MENU_ITEM(widget)->active)
+    if (draw_city_names ^ GTK_CHECK_MENU_ITEM(widget)->active) {
       key_city_names_toggle();
+      menus_set_sensitive("<main>/_View/City G_rowth", draw_city_names);
+    }
+    break;
+  case MENU_VIEW_SHOW_CITY_GROWTH_TURNS:
+    if (draw_city_growth ^ GTK_CHECK_MENU_ITEM(widget)->active)
+      key_city_growth_toggle();
     break;
   case MENU_VIEW_SHOW_CITY_PRODUCTIONS:
     if (draw_city_productions ^ GTK_CHECK_MENU_ITEM(widget)->active)
@@ -600,6 +607,8 @@
        view_menu_callback,     MENU_VIEW_SHOW_MAP_GRID,                
"<CheckItem>"   },
   { "/" N_("View") "/" N_("City _Names"),              "<control>n",
        view_menu_callback,     MENU_VIEW_SHOW_CITY_NAMES,              
"<CheckItem>"   },
+  { "/" N_("View") "/" N_("City G_rowth"),             "<control>r",
+       view_menu_callback,     MENU_VIEW_SHOW_CITY_GROWTH_TURNS,       
"<CheckItem>"   },
   { "/" N_("View") "/" N_("City _Productions"),                "<control>p",
        view_menu_callback,     MENU_VIEW_SHOW_CITY_PRODUCTIONS,        
"<CheckItem>"   },
   { "/" N_("View") "/sep1",                            NULL,
@@ -977,6 +986,8 @@
 
     menus_set_active("<main>/_View/Map _Grid", draw_map_grid);
     menus_set_active("<main>/_View/City _Names", draw_city_names);
+    menus_set_sensitive("<main>/_View/City G_rowth", draw_city_names);
+    menus_set_active("<main>/_View/City G_rowth", draw_city_growth);
     menus_set_active("<main>/_View/City _Productions", draw_city_productions);
     menus_set_active("<main>/_View/Terrain", draw_terrain);
     menus_set_active("<main>/_View/Coastline", draw_coastline);
Index: client/gui-xaw/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.c,v
retrieving revision 1.103
diff -u -r1.103 mapview.c
--- client/gui-xaw/mapview.c    2002/11/17 02:21:12     1.103
+++ client/gui-xaw/mapview.c    2002/11/17 21:54:31
@@ -733,22 +733,23 @@
 }
 
 /**************************************************************************
-Draw at x = center of string, y = top of string.
+Draw at x = left of string, y = top of string.
 **************************************************************************/
 static void draw_shadowed_string(XFontStruct * font, GC font_gc,
-                                         int x, int y, const char *string)
+                                enum color_std foreground,
+                                enum color_std shadow,
+                                int x, int y, const char *string)
 {
-  Window wndw=XtWindow(map_canvas);
-  int len=strlen(string);
-  int wth=XTextWidth(font, string, len);
-  int xs=x-wth/2;
-  int ys=y+font->ascent;
+  Window wndw = XtWindow(map_canvas);
+  size_t len = strlen(string);
 
-  XSetForeground(display, font_gc, colors_standard[COLOR_STD_BLACK]);
-  XDrawString(display, wndw, font_gc, xs+1, ys+1, string, len);
+  y += font->ascent;
 
-  XSetForeground(display, font_gc, colors_standard[COLOR_STD_WHITE]);
-  XDrawString(display, wndw, font_gc, xs, ys, string, len);
+  XSetForeground(display, font_gc, colors_standard[shadow]);
+  XDrawString(display, wndw, font_gc, x + 1, y + 1, string, len);
+
+  XSetForeground(display, font_gc, colors_standard[foreground]);
+  XDrawString(display, wndw, font_gc, x, y, string, len);
 }
 
 /**************************************************************************
@@ -769,31 +770,44 @@
 
       if (!normalize_map_pos(&rx, &ry))
         continue;
-
-      if((pcity=map_get_city(rx, ry))) {
 
-       if (draw_city_names) {
-         draw_shadowed_string(main_font_struct, font_gc,
-                              x*NORMAL_TILE_WIDTH+NORMAL_TILE_WIDTH/2,
-                              (y+1)*NORMAL_TILE_HEIGHT,
-                              pcity->name);
-       }
+      if ((pcity = map_get_city(rx, ry))) {
+       char buffer[512], buffer2[512];
+       enum color_std color;
+       int w, w2;
+
+       get_city_mapview_name_and_growth(pcity, buffer, sizeof(buffer),
+                                        buffer2, sizeof(buffer2), &color);
+
+       w = XTextWidth(main_font_struct, buffer, strlen(buffer));
+       w2 = XTextWidth(main_font_struct, buffer2, strlen(buffer2));
+
+       draw_shadowed_string(main_font_struct, font_gc,
+                            COLOR_STD_WHITE, COLOR_STD_BLACK,
+                            x * NORMAL_TILE_WIDTH +
+                            NORMAL_TILE_WIDTH / 2 - (w + w2) / 2,
+                            (y + 1) * NORMAL_TILE_HEIGHT, buffer);
+
+       draw_shadowed_string(prod_font_struct, prod_font_gc, color,
+                            COLOR_STD_BLACK,
+                            x * NORMAL_TILE_WIDTH + NORMAL_TILE_WIDTH / 2 -
+                            (w + w2) / 2 + w, (y + 1) * NORMAL_TILE_HEIGHT,
+                            buffer2);
+
+       if (draw_city_productions && (pcity->owner == game.player_idx)) {
+         int yoffset = (draw_city_names ? main_font_struct->ascent +
+                        main_font_struct->descent : 0);
 
-       if (draw_city_productions && (pcity->owner==game.player_idx)) {
-         char buffer[512];
-       
           get_city_mapview_production(pcity, buffer, sizeof(buffer));
+         w = XTextWidth(prod_font_struct, buffer, strlen(buffer));
 
          draw_shadowed_string(prod_font_struct, prod_font_gc,
-                              x*NORMAL_TILE_WIDTH+NORMAL_TILE_WIDTH/2,
-                              (y+1)*NORMAL_TILE_HEIGHT +
-                                (draw_city_names ?
-                                  main_font_struct->ascent +
-                                    main_font_struct->descent :
-                                  0),
-                              buffer);
+                              COLOR_STD_WHITE, COLOR_STD_BLACK,
+                              x * NORMAL_TILE_WIDTH +
+                              NORMAL_TILE_WIDTH / 2 - w / 2,
+                              (y + 1) * NORMAL_TILE_HEIGHT +
+                              yoffset, buffer);
        }
-
       }
     }
   }
Index: client/gui-xaw/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.c,v
retrieving revision 1.50
diff -u -r1.50 menu.c
--- client/gui-xaw/menu.c       2002/11/14 09:15:01     1.50
+++ client/gui-xaw/menu.c       2002/11/17 21:54:33
@@ -129,6 +129,8 @@
 static struct MenuEntry view_menu_entries[]={
     { { N_("Map Grid"), 0             }, "ctl-g", MENU_VIEW_SHOW_MAP_GRID, 0 },
     { { N_("City Names"), 0           }, "ctl-n", MENU_VIEW_SHOW_CITY_NAMES, 0 
},
+    { { N_("City Growth"), 0          }, "ctl-r",
+      MENU_VIEW_SHOW_CITY_GROWTH, 0 },
     { { N_("City Productions"), 0     }, "ctl-p", 
MENU_VIEW_SHOW_CITY_PRODUCTIONS, 0 },
     { { 0                             },      "", MENU_SEPARATOR_LINE, 0 },
     { { N_("Terrain"), 0              },      "", MENU_VIEW_SHOW_TERRAIN, 0 },
@@ -277,6 +279,8 @@
     XtSetSensitive(menus[MENU_VIEW]->button, True);
     XtSetSensitive(menus[MENU_KINGDOM]->button, True);
 
+    menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_CITY_GROWTH,
+                        draw_city_names);
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_TERRAIN, 1);
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_COASTLINE, !draw_terrain);
     menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_ROADS_RAILS, 1);
@@ -503,6 +507,11 @@
     break;
   case MENU_VIEW_SHOW_CITY_NAMES:
     key_city_names_toggle();
+    menu_entry_sensitive(MENU_VIEW, MENU_VIEW_SHOW_CITY_GROWTH,
+                        draw_city_names);
+    break;
+  case MENU_VIEW_SHOW_CITY_GROWTH:
+    key_city_growth_toggle();
     break;
   case MENU_VIEW_SHOW_CITY_PRODUCTIONS:
     key_city_productions_toggle();
Index: client/gui-xaw/menu.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.h,v
retrieving revision 1.13
diff -u -r1.13 menu.h
--- client/gui-xaw/menu.h       2001/04/20 22:16:01     1.13
+++ client/gui-xaw/menu.h       2002/11/17 21:54:34
@@ -50,6 +50,7 @@
 
   MENU_VIEW_SHOW_MAP_GRID,
   MENU_VIEW_SHOW_CITY_NAMES,
+  MENU_VIEW_SHOW_CITY_GROWTH,
   MENU_VIEW_SHOW_CITY_PRODUCTIONS,
   MENU_VIEW_SHOW_TERRAIN,
   MENU_VIEW_SHOW_COASTLINE,

[Prev in Thread] Current Thread [Next in Thread]