Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] [Patch (Gtk)] Show map tile infrastructure in map window/l
Home

[Freeciv-Dev] [Patch (Gtk)] Show map tile infrastructure in map window/l

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: <freeciv-dev@xxxxxxxxxxx>
Cc: "Andreas Beckmann" <andreas.beckmann@xxxxxxxxxxxxxxxxxxxx>
Subject: [Freeciv-Dev] [Patch (Gtk)] Show map tile infrastructure in map window/left panel.
From: "Andreas Beckmann" <andreas.beckmann@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 Sep 2001 09:11:16 +0200

Hi,

I missed the information about the infrastructure of the current tile in the
left panel of the map window.
The following patch adds the infrastructure string used in the middle click
popup to the map window. (Gtk only).

Perhaps the settler progress could be displayed there, too?

----cut------------------------------------------------------------
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.99
diff -u -u -r1.99 mapview.c
--- client/gui-gtk/mapview.c 2001/09/23 16:09:35 1.99
+++ client/gui-gtk/mapview.c 2001/09/26 22:29:06
@@ -536,18 +536,22 @@
   if(punit) {
     char buffer[512];
     struct city *pcity;
+    int infrastructure;
     pcity=player_find_city_by_id(game.player_ptr, punit->homecity);
+    infrastructure = get_tile_infrastructure_set(map_get_tile(punit->x,
punit->y));

     my_snprintf(buffer, sizeof(buffer), "%s %s",
             unit_type(punit)->name,
             (punit->veteran) ? _("(veteran)") : "" );
     gtk_frame_set_label( GTK_FRAME(unit_info_frame), buffer);

-    my_snprintf(buffer, sizeof(buffer), "%s\n%s\n%s",
+    my_snprintf(buffer, sizeof(buffer), "%s\n%s\n%s%s%s",
   (hover_unit == punit->id) ?
   _("Select destination") : unit_activity_text(punit),
   map_get_tile_info_text(punit->x, punit->y),
-            pcity ? pcity->name : "");
+  infrastructure ? map_get_infrastructure_text(infrastructure) : "",
+  infrastructure ? "\n" : "",
+  pcity ? pcity->name : "");
     gtk_set_label( unit_info_label, buffer);

     if (hover_unit != punit->id)
----cut------------------------------------------------------------


Andreas

--
CPU time is a terrible thing to waste!
Join the world's fastest computer - http://www.distributed.net - Team #11292




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] [Patch (Gtk)] Show map tile infrastructure in map window/left panel., Andreas Beckmann <=