Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2005:
[Freeciv-Dev] (PR#14012) Large city bar and show production button
Home

[Freeciv-Dev] (PR#14012) Large city bar and show production button

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mstefek@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#14012) Large city bar and show production button
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Sep 2005 17:57:05 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14012 >

> [mstefek - Sun Sep 18 09:19:22 2005]:
> 
> Turn the "large citybar" option on. Turn of the "show city production"
> option. Change production in a city. The citybar isn't updated.
> 
> This was reported on the forum:
> http://forum.freeciv.org/viewtopic.php?t=1260

Here's a quick fix.

> Another problem is that the "show city production" should be defined
> somehow with the large citybar.

Not sure what you mean here.

-jason

Index: client/options.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/options.h,v
retrieving revision 1.56
diff -p -u -r1.56 options.h
--- client/options.h    3 Sep 2005 10:07:18 -0000       1.56
+++ client/options.h    24 Sep 2005 00:52:25 -0000
@@ -144,6 +144,12 @@ extern bool draw_borders;
 extern bool draw_full_citybar;
 extern bool draw_unit_shields;
 
+/* It would probably be better to have function calls for these checks. */
+#define DRAW_CITY_PRODUCTIONS (draw_city_productions \
+                              || (draw_full_citybar && draw_city_growth))
+#define DRAW_CITY_GROWTH (draw_city_growth \
+                         || (draw_full_citybar && draw_city_productions))
+
 extern bool player_dlg_show_dead_players;
 
 extern bool reqtree_show_icons;
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.548
diff -p -u -r1.548 packhand.c
--- client/packhand.c   5 Sep 2005 15:55:45 -0000       1.548
+++ client/packhand.c   24 Sep 2005 00:52:42 -0000
@@ -408,13 +408,13 @@ void handle_city_info(struct packet_city
     /* Check if city desciptions should be updated */
     if (draw_city_names && name_changed) {
       update_descriptions = TRUE;
-    } else if (draw_city_productions
+    } else if (DRAW_CITY_PRODUCTIONS
               && (pcity->production.is_unit != packet->production_is_unit
                   || pcity->production.value != packet->production_value
                   || pcity->surplus[O_SHIELD] != packet->surplus[O_SHIELD]
                   || pcity->shield_stock != packet->shield_stock)) {
       update_descriptions = TRUE;
-    } else if (draw_city_names && draw_city_growth &&
+    } else if (draw_city_names && DRAW_CITY_GROWTH &&
               (pcity->food_stock != packet->food_stock ||
                pcity->surplus[O_FOOD] != packet->surplus[O_FOOD])) {
       /* If either the food stock or surplus have changed, the time-to-grow

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