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:42:56 -0800
Reply-to: bugs@xxxxxxxxxxx

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

> [vasc - Wed Jan 05 01:37:39 2005]:
> 
> Patch by Filip Van Raemdonck, used in Debian. Jordi pointed to it.

This is the same patch, but changed so it applies to CVS HEAD.

Index: client/gui-gtk-2.0/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/dialogs.c,v
retrieving revision 1.86
diff -u -r1.86 dialogs.c
--- client/gui-gtk-2.0/dialogs.c        19 Dec 2004 16:47:08 -0000      1.86
+++ client/gui-gtk-2.0/dialogs.c        5 Jan 2005 01:41:54 -0000
@@ -960,8 +960,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[128];
+  bool can_establish, can_trade, can_wonder;
   
   my_snprintf(buf, sizeof(buf),
              _("Your caravan from %s reaches the city of %s.\nWhat now?"),
@@ -973,13 +973,23 @@
   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);
 
@@ -990,7 +1000,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]