Index: client/control.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/control.c,v retrieving revision 1.47 diff -u -r1.47 control.c --- control.c 2000/08/14 12:42:00 1.47 +++ control.c 2000/08/16 07:13:46 @@ -827,6 +827,18 @@ } /************************************************************************** + Toggle display of city food/production/trade +**************************************************************************/ +void request_toggle_city_fpt(void) +{ + if (get_client_state() != CLIENT_GAME_RUNNING_STATE) + return; + + draw_city_fpt ^= 1; + update_map_canvas_visible(); +} + +/************************************************************************** ... **************************************************************************/ void do_move_unit(struct unit *punit, struct packet_unit_info *pinfo) @@ -1157,6 +1169,14 @@ void key_city_productions_toggle(void) { request_toggle_city_productions(); +} + +/************************************************************************** +... +**************************************************************************/ +void key_city_fpt_toggle(void) +{ + request_toggle_city_fpt(); } /************************************************************************** Index: client/control.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/control.h,v retrieving revision 1.18 diff -u -r1.18 control.h --- control.h 2000/07/10 06:31:21 1.18 +++ control.h 2000/08/16 07:13:54 @@ -49,6 +49,7 @@ void request_toggle_map_grid(void); void request_toggle_city_names(void); void request_toggle_city_productions(void); +void request_toggle_city_fpt(void); void wakeup_sentried_units(int x, int y); @@ -70,6 +71,7 @@ void key_cancel_action(void); void key_city_names_toggle(void); void key_city_productions_toggle(void); +void key_city_fpt_toggle(void); void key_end_turn(void); void key_map_grid_toggle(void); void key_move_north(void); Index: client/options.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/options.c,v retrieving revision 1.35 diff -u -r1.35 options.c --- options.c 2000/08/07 14:12:03 1.35 +++ options.c 2000/08/16 07:13:54 @@ -75,6 +75,7 @@ int draw_map_grid=0; int draw_city_names=1; int draw_city_productions=0; +int draw_city_fpt=0; #define VIEW_OPTION(name) { #name, &name } #define VIEW_OPTION_TERMINATOR { NULL, NULL } Index: client/options.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/options.h,v retrieving revision 1.8 diff -u -r1.8 options.h --- options.h 2000/06/25 13:16:16 1.8 +++ options.h 2000/08/16 07:13:54 @@ -50,6 +50,7 @@ extern int draw_map_grid; extern int draw_city_names; extern int draw_city_productions; +extern int draw_city_fpt; typedef struct { char *name; Index: client/gui-gtk/mapview.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v retrieving revision 1.66 diff -u -r1.66 mapview.c --- mapview.c 2000/07/30 12:53:16 1.66 +++ mapview.c 2000/08/16 07:13:58 @@ -869,7 +869,7 @@ int x, y; static char buffer[512]; - if (!draw_city_names && !draw_city_productions) + if (!draw_city_names && !draw_city_productions && !draw_city_fpt) return; for (y = 0; y < map_canvas_store_theight; ++y) { @@ -878,7 +878,7 @@ int rx = (map_view_x0 + x) % map.xsize; struct city *pcity; if ((pcity = map_get_city(rx, ry))) { - int w; + int w, y_offset=0; if (draw_city_names) { my_snprintf(buffer, sizeof(buffer), "%s", pcity->name); @@ -890,10 +890,11 @@ NORMAL_TILE_WIDTH / 2 - w / 2, (y + 1) * NORMAL_TILE_HEIGHT + main_font->ascent, buffer); + y_offset += main_font->ascent + main_font->descent; } if (draw_city_productions && (pcity->owner==game.player_idx)) { - int turns, y_offset; + int turns; struct unit_type *punit_type; struct impr_type *pimprovement_type; @@ -914,10 +915,22 @@ pimprovement_type->name, turns); } } - if (draw_city_names) - y_offset = main_font->ascent + main_font->descent; - else - y_offset = 0; + w = gdk_string_width(city_productions_font, buffer); + draw_shadowed_string(map_canvas->window, city_productions_font, + toplevel->style->black_gc, + toplevel->style->white_gc, + x * NORMAL_TILE_WIDTH + + NORMAL_TILE_WIDTH / 2 - w / 2, + (y + 1) * NORMAL_TILE_HEIGHT + + main_font->ascent + y_offset, buffer); + y_offset += city_productions_font->ascent + city_productions_font->descent; + } + + if (draw_city_fpt && (pcity->owner==game.player_idx)) { + my_snprintf(buffer, sizeof(buffer), "FTP %d/%d/%d", + pcity->food_surplus, + pcity->shield_surplus, + pcity->trade_prod); w = gdk_string_width(city_productions_font, buffer); draw_shadowed_string(map_canvas->window, city_productions_font, toplevel->style->black_gc, Index: client/gui-gtk/menu.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/menu.c,v retrieving revision 1.38 diff -u -r1.38 menu.c --- menu.c 2000/08/03 19:14:53 1.38 +++ menu.c 2000/08/16 07:14:03 @@ -83,6 +83,7 @@ MENU_VIEW_SHOW_MAP_GRID, MENU_VIEW_SHOW_CITY_NAMES, MENU_VIEW_SHOW_CITY_PRODUCTIONS, + MENU_VIEW_SHOW_CITY_FPT, MENU_VIEW_CENTER_VIEW, MENU_ORDER_AUTO_SETTLER, @@ -228,6 +229,10 @@ if (draw_city_productions ^ GTK_CHECK_MENU_ITEM(widget)->active) key_city_productions_toggle(); break; + case MENU_VIEW_SHOW_CITY_FPT: + if (draw_city_fpt ^ GTK_CHECK_MENU_ITEM(widget)->active) + key_city_fpt_toggle(); + break; case MENU_VIEW_CENTER_VIEW: center_on_unit(); break; @@ -541,6 +546,8 @@ MENU_VIEW_SHOW_CITY_NAMES, "" }, { "/" N_("View") "/" N_("City Productions"), "p", view_menu_callback, MENU_VIEW_SHOW_CITY_PRODUCTIONS, "" }, + { "/" N_("View") "/" N_("City FPT"), "i", view_menu_callback, + MENU_VIEW_SHOW_CITY_FPT, "" }, { "/" N_("View") "/sep1", NULL, NULL, 0, "" }, { "/" N_("View") "/" N_("Center View"), "c", view_menu_callback,