Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#5378) Diplomacy information in map middle-click
Home

[Freeciv-Dev] (PR#5378) Diplomacy information in map middle-click

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#5378) Diplomacy information in map middle-click
From: "Daniel L Speyer" <dspeyer@xxxxxxxxxxx>
Date: Sat, 23 Aug 2003 11:35:46 -0700
Reply-to: rt@xxxxxxxxxxxxxx

I've been playing with diplomacy and borders lately, and I've been 
getting annoyed at the need to go to the players dialog to find out if 
territory is friendly or not.  I want to be able to just middle-click 
and find out.  For that purpose, I have written this patch, which throws 
in that information.  (It also corrects the annoying grammatical error 
the current code suffers from "Claimed by American"? WTF?)

Here's the patch:
--- freeciv-cvs-Aug-13-orig/client/gui-gtk/mapctrl.c    2003-08-13 
22:41:26.0000              
00000 +0000
+++ freeciv-cvs-Aug-13/client/gui-gtk/mapctrl.c 2003-08-23 
13:50:12.000000000 +0              
000
@@ -77,6 +77,8 @@
   struct city *pcity;
   struct unit *punit;
   struct tile *ptile = map_get_tile(xtile, ytile);
+  char *descriptions[DS_LAST]={_("Neutral"), _("Hostile"), "" 
/*Ceasefire*/,
+                              _("Peaceful"), _("Allied"), _("Mysterious")};
 
   if(tile_get_known(xtile, ytile) >= TILE_KNOWN_FOGGED) {
     p=gtk_window_new(GTK_WINDOW_POPUP);
@@ -109,9 +111,20 @@
     pcity = map_get_city(xtile, ytile);
     if (game.borders > 0 && !pcity) {
       struct player *owner = map_get_owner(xtile, ytile);
-      if (owner) {
-       my_snprintf(s, sizeof(s), _("Claimed by %s"),
-                   get_nation_name(owner->nation));
+      if (owner == game.player_ptr) {
+       gtk_widget_new(GTK_TYPE_LABEL, "GtkWidget::parent", b,
+                                      "GtkLabel::label",
+                                      _("Our territory"), NULL);      
+      }else if (owner) {
+       if (owner->diplstates[game.player_idx].type == DS_CEASEFIRE){
+         my_snprintf(s, sizeof(s), _("%s territory (%d turn ceasefire)"),
+                     get_nation_name(owner->nation),
+                     owner->diplstates[game.player_idx].turns_left);
+       }else{
+         my_snprintf(s, sizeof(s), _("%s (%s) territory"),
+                     get_nation_name(owner->nation),
+                     
descriptions[owner->diplstates[game.player_idx].type]);
+       }
        gtk_widget_new(GTK_TYPE_LABEL, "GtkWidget::parent", b,
                                       "GtkLabel::label", s, NULL);
       } else {





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#5378) Diplomacy information in map middle-click, Daniel L Speyer <=