Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] (PR#11796) add remaining city production info to help buil
Home

[Freeciv-Dev] (PR#11796) add remaining city production info to help buil

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11796) add remaining city production info to help build wonder.
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Tue, 4 Jan 2005 17:37:41 -0800
Reply-to: bugs@xxxxxxxxxxx

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

Patch by Filip Van Raemdonck, used in Debian. Jordi pointed to it.

--- freeciv/client/gui-gtk-2.0/dialogs.c.orig
+++ freeciv/client/gui-gtk-2.0/dialogs.c
@@ -959,8 +959,8 @@
 void popup_caravan_dialog(struct unit *punit,
                           struct city *phomecity, struct city *pdestcity)
 {
-  char buf[128];
-  bool can_establish, can_trade;
+  char buf[128], wonder[64];
+  bool can_establish, can_trade, can_wonder;
   
   my_snprintf(buf, sizeof(buf),
               _("Your caravan from %s reaches the city of %s.\nWhat now?"),
@@ -972,13 +972,22 @@
   can_trade = can_cities_trade(phomecity, pdestcity);
   can_establish = can_trade
                     && can_establish_trade_route(phomecity, pdestcity);
-  
+
+  if (unit_can_help_build_wonder(punit, pdestcity)) {
+    my_snprintf(wonder, sizeof(wonder), _("Help build _Wonder (%d remaining)"),
+          impr_build_shield_cost(pdestcity->currently_building) - 
pdestcity->shield_stock);
+    can_wonder = TRUE;
+  } else {
+    my_snprintf(wonder, sizeof(wonder), _("Help build _Wonder"));
+    can_wonder = FALSE;
+  }
+
   caravan_dialog = popup_message_dialog(GTK_WINDOW(toplevel),
     _("Your Caravan Has Arrived"), 
     buf,
     (can_establish ? _("Establish _Traderoute") :
     _("Enter Marketplace")),caravan_establish_trade_callback, NULL,
-    _("Help build _Wonder"),caravan_help_build_wonder_callback, NULL,
+    wonder,caravan_help_build_wonder_callback, NULL,
     _("_Keep moving"), NULL, NULL,
     NULL);
 
@@ -989,7 +998,7 @@
     message_dialog_button_set_sensitive(caravan_dialog, 0, FALSE);
   }
   
-  if (!unit_can_help_build_wonder(punit, pdestcity)) {
+  if (!can_wonder) {
     message_dialog_button_set_sensitive(caravan_dialog, 1, FALSE);
   }
 }

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