Author: jtn
Date: Sat Mar 14 17:57:31 2015
New Revision: 28544

URL: http://svn.gna.org/viewcvs/freeciv?rev=28544&view=rev
Log:
Show armistice turn count as well as ceasefire turn count in terrain
info popups.

See gna bug #23303.

Modified:
    branches/S2_5/client/gui-sdl/mapview.c
    branches/S2_5/client/text.c

Modified: branches/S2_5/client/gui-sdl/mapview.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/mapview.c?rev=28544&r1=28543&r2=28544&view=diff
==============================================================================
--- branches/S2_5/client/gui-sdl/mapview.c      (original)
+++ branches/S2_5/client/gui-sdl/mapview.c      Sat Mar 14 17:57:31 2015
@@ -562,8 +562,8 @@
 
           if (BORDERS_DISABLED != game.info.borders && !pCity) {
            const char *diplo_nation_plural_adjectives[DS_LAST] =
-                        {Q_("?nation:Neutral"), Q_("?nation:Hostile"),
-                       "" /* unused, DS_CEASEFIRE*/,
+                       {"" /* unused, DS_ARMISTICE */, Q_("?nation:Hostile"),
+                        "" /* unused, DS_CEASEFIRE */,
                        Q_("?nation:Peaceful"), Q_("?nation:Friendly"), 
                        Q_("?nation:Mysterious")};
             if (tile_owner(pTile) == client.conn.playing) {
@@ -573,12 +573,18 @@
                 struct player_diplstate *ds
                   = player_diplstate_get(client.conn.playing,
                                          tile_owner(pTile));
-                if (DS_CEASEFIRE == ds->type){
+                if (DS_CEASEFIRE == ds->type) {
                   int turns = ds->turns_left;
-                 cat_snprintf(buffer, sizeof(buffer),
-                       PL_("\n%s territory (%d turn ceasefire)",
-                               "\n%s territory (%d turn ceasefire)", turns),
-                               nation_adjective_for_player(tile_owner(pTile)), 
turns);
+                  cat_snprintf(buffer, sizeof(buffer),
+                        PL_("\n%s territory (%d turn ceasefire)",
+                            "\n%s territory (%d turn ceasefire)", turns),
+                        nation_adjective_for_player(tile_owner(pTile)), turns);
+                } else if (DS_ARMISTICE == ds->type) {
+                  int turns = ds->turns_left;
+                  cat_snprintf(buffer, sizeof(buffer),
+                        PL_("\n%s territory (%d turn armistice)",
+                            "\n%s territory (%d turn armistice)", turns),
+                        nation_adjective_for_player(tile_owner(pTile)), turns);
                 } else {
                   cat_snprintf(buffer, sizeof(buffer), _("\nTerritory of the 
%s %s"),
                     diplo_nation_plural_adjectives[ds->type],
@@ -596,8 +602,8 @@
             struct player *pOwner = city_owner(pCity);
 /*            bool barrack = FALSE, airport = FALSE, port = FALSE;*/
            const char *diplo_city_adjectives[DS_LAST] =
-                       {Q_("?city:Neutral"), Q_("?city:Hostile"),
-                         "" /*unused, DS_CEASEFIRE */, Q_("?city:Peaceful"),
+                       {Q_("?city:Neutral"), Q_("?city:Hostile"),
+                         Q_("?city:Neutral"), Q_("?city:Peaceful"),
                          Q_("?city:Friendly"), Q_("?city:Mysterious")};
                          
            cat_snprintf(buffer, sizeof(buffer),

Modified: branches/S2_5/client/text.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/text.c?rev=28544&r1=28543&r2=28544&view=diff
==============================================================================
--- branches/S2_5/client/text.c (original)
+++ branches/S2_5/client/text.c Sat Mar 14 17:57:31 2015
@@ -140,13 +140,13 @@
   struct city *pcity = tile_city(ptile);
   struct unit *punit = find_visible_unit(ptile);
   const char *diplo_nation_plural_adjectives[DS_LAST] =
-    {Q_("?nation:Neutral"), Q_("?nation:Hostile"),
-     Q_("?nation:Neutral"),
+    {"" /* unused, DS_ARMISTICE */, Q_("?nation:Hostile"),
+     "" /* unused, DS_CEASEFIRE */,
      Q_("?nation:Peaceful"), Q_("?nation:Friendly"), 
      Q_("?nation:Mysterious"), Q_("?nation:Friendly(team)")};
   const char *diplo_city_adjectives[DS_LAST] =
-    {Q_("?city:Neutral"), Q_("?city:Hostile"),
-     Q_("?nation:Neutral"),
+    {"" /* unused, DS_ARMISTICE */, Q_("?city:Hostile"),
+     "" /* unused, DS_CEASEFIRE */,
      Q_("?city:Peaceful"), Q_("?city:Friendly"), Q_("?city:Mysterious"),
      Q_("?city:Friendly(team)")};
   static struct astring str = ASTRING_INIT;
@@ -197,6 +197,16 @@
                           "Territory of %s (%s) (%d turn cease-fire)",
                           turns),
                       username, nation, turns);
+      } else if (ds->type == DS_ARMISTICE) {
+        int turns = ds->turns_left;
+
+        astr_add_line(&str,
+                      /* TRANS: "Territory of <username> (<nation + team>)
+                       * (<number> turn armistice)" */
+                      PL_("Territory of %s (%s) (%d turn armistice)",
+                          "Territory of %s (%s) (%d turn armistice)",
+                          turns),
+                      username, nation, turns);
       } else {
         int type = ds->type;
 
@@ -234,6 +244,15 @@
          * (<nation + team>, <number> turn cease-fire)" */
         astr_add_line(&str, PL_("City: %s | %s (%s, %d turn cease-fire)",
                                 "City: %s | %s (%s, %d turn cease-fire)",
+                                turns),
+                      city_name(pcity), username, nation, turns);
+      } else if (ds->type == DS_ARMISTICE) {
+        int turns = ds->turns_left;
+
+        /* TRANS:  "City: <city name> | <username>
+         * (<nation + team>, <number> turn armistice)" */
+        astr_add_line(&str, PL_("City: %s | %s (%s, %d turn armistice)",
+                                "City: %s | %s (%s, %d turn armistice)",
                                 turns),
                       city_name(pcity), username, nation, turns);
       } else {
@@ -333,6 +352,16 @@
          * <number> turn cease-fire)" */
         astr_add_line(&str, PL_("Unit: %s | %s (%s, %d turn cease-fire)",
                                 "Unit: %s | %s (%s, %d turn cease-fire)",
+                                turns),
+                      utype_name_translation(ptype),
+                      username, nation, turns);
+      } else if (ds->type == DS_ARMISTICE) {
+        int turns = ds->turns_left;
+
+        /* TRANS:  "Unit: <unit type> | <username> (<nation + team>,
+         * <number> turn armistice)" */
+        astr_add_line(&str, PL_("Unit: %s | %s (%s, %d turn armistice)",
+                                "Unit: %s | %s (%s, %d turn armistice)",
                                 turns),
                       utype_name_translation(ptype),
                       username, nation, turns);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to