Author: cazfi
Date: Sun Oct  2 19:12:17 2016
New Revision: 33963

URL: http://svn.gna.org/viewcvs/freeciv?rev=33963&view=rev
Log:
Added support for helptexts for goods.

See patch #7741

Modified:
    trunk/client/helpdata.c
    trunk/client/packhand.c
    trunk/common/networking/packets.def
    trunk/common/traderoutes.c
    trunk/common/traderoutes.h
    trunk/data/alien/game.ruleset
    trunk/data/civ1/game.ruleset
    trunk/data/civ2/game.ruleset
    trunk/data/civ2civ3/game.ruleset
    trunk/data/classic/game.ruleset
    trunk/data/experimental/game.ruleset
    trunk/data/multiplayer/game.ruleset
    trunk/data/ruledit/comments.txt
    trunk/data/sandbox/game.ruleset
    trunk/data/stub/game.ruleset
    trunk/data/webperimental/game.ruleset
    trunk/fc_version
    trunk/server/ruleset.c
    trunk/tools/ruleutil/rulesave.c

Modified: trunk/client/helpdata.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/client/helpdata.c     (original)
+++ trunk/client/helpdata.c     Sun Oct  2 19:12:17 2016
@@ -2819,13 +2819,11 @@
   fc_assert_ret(NULL != buf && 0 < bufsz);
   buf[0] = '\0';
 
-  /* 
   if (NULL != pgood->helptext) {
     strvec_iterate(pgood->helptext, text) {
       cat_snprintf(buf, bufsz, "%s\n\n", _(text));
     } strvec_iterate_end;
   }
-  */
 
   cat_snprintf(buf, bufsz, _("Sending city enjoys %d%% income from the 
route.\n"),
                pgood->from_pct);

Modified: trunk/client/packhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/packhand.c?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/client/packhand.c     (original)
+++ trunk/client/packhand.c     Sun Oct  2 19:12:17 2016
@@ -3944,6 +3944,8 @@
   pgood->from_pct = p->from_pct;
   pgood->to_pct = p->to_pct;
   pgood->flags = p->flags;
+
+  PACKET_STRVEC_EXTRACT(pgood->helptext, p->helptext);
 }
 
 /**************************************************************************

Modified: trunk/common/networking/packets.def
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/networking/packets.def?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/common/networking/packets.def (original)
+++ trunk/common/networking/packets.def Sun Oct  2 19:12:17 2016
@@ -1701,6 +1701,7 @@
   UINT16 from_pct;
   UINT16 to_pct;
   BV_GOODS_FLAGS flags;
+  STRVEC helptext[MAX_LEN_PACKET];
 end
 
 PACKET_RULESET_DISASTER = 224; sc, lsend

Modified: trunk/common/traderoutes.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/traderoutes.c?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/common/traderoutes.c  (original)
+++ trunk/common/traderoutes.c  Sun Oct  2 19:12:17 2016
@@ -429,6 +429,7 @@
 
     requirement_vector_init(&(goods[i].reqs));
     goods[i].disabled = FALSE;
+    goods[i].helptext = NULL;
   }
 }
 
@@ -441,6 +442,11 @@
 
   for (i = 0; i < MAX_GOODS_TYPES; i++) {
     requirement_vector_free(&(goods[i].reqs));
+
+    if (NULL != goods[i].helptext) {
+      strvec_destroy(goods[i].helptext);
+      goods[i].helptext = NULL;
+    }
   }
 }
 

Modified: trunk/common/traderoutes.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/traderoutes.h?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/common/traderoutes.h  (original)
+++ trunk/common/traderoutes.h  Sun Oct  2 19:12:17 2016
@@ -176,6 +176,8 @@
   int to_pct;
 
   bv_goods_flags flags;
+
+  struct strvec *helptext;
 };
 
 void goods_init(void);

Modified: trunk/data/alien/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/alien/game.ruleset       (original)
+++ trunk/data/alien/game.ruleset       Sun Oct  2 19:12:17 2016
@@ -776,6 +776,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/civ1/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/civ1/game.ruleset        (original)
+++ trunk/data/civ1/game.ruleset        Sun Oct  2 19:12:17 2016
@@ -770,6 +770,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/civ2/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/civ2/game.ruleset        (original)
+++ trunk/data/civ2/game.ruleset        Sun Oct  2 19:12:17 2016
@@ -804,6 +804,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/civ2civ3/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/civ2civ3/game.ruleset    (original)
+++ trunk/data/civ2civ3/game.ruleset    Sun Oct  2 19:12:17 2016
@@ -957,6 +957,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/classic/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/classic/game.ruleset     (original)
+++ trunk/data/classic/game.ruleset     Sun Oct  2 19:12:17 2016
@@ -838,6 +838,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/experimental/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/experimental/game.ruleset        (original)
+++ trunk/data/experimental/game.ruleset        Sun Oct  2 19:12:17 2016
@@ -867,6 +867,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/multiplayer/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/multiplayer/game.ruleset (original)
+++ trunk/data/multiplayer/game.ruleset Sun Oct  2 19:12:17 2016
@@ -790,6 +790,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/ruledit/comments.txt
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/ruledit/comments.txt?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/ruledit/comments.txt     (original)
+++ trunk/data/ruledit/comments.txt     Sun Oct  2 19:12:17 2016
@@ -982,6 +982,8 @@
 ;   - \"Depletes\"          = Trade route gets cancelled when the source city 
cannot provide\n\
 ;                           goods any more. Bidirectional routes gets 
cancelled if either\n\
 ;                           one of the involved cities cannot provide goods.\n\
+; helptext                = Optional help text string; should escape all raw\n\
+;                           newlines so that xgettext parsing works\n\
 ;\n\
 ; */ <-- avoid gettext warnings\n\
 "

Modified: trunk/data/sandbox/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/sandbox/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/sandbox/game.ruleset     (original)
+++ trunk/data/sandbox/game.ruleset     Sun Oct  2 19:12:17 2016
@@ -1044,6 +1044,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/stub/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/stub/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/stub/game.ruleset        (original)
+++ trunk/data/stub/game.ruleset        Sun Oct  2 19:12:17 2016
@@ -464,6 +464,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/data/webperimental/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/webperimental/game.ruleset?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/data/webperimental/game.ruleset       (original)
+++ trunk/data/webperimental/game.ruleset       Sun Oct  2 19:12:17 2016
@@ -1042,6 +1042,8 @@
 ;   - "Depletes"          = Trade route gets cancelled when the source city 
cannot provide
 ;                           goods any more. Bidirectional routes gets 
cancelled if either
 ;                           one of the involved cities cannot provide goods.
+; helptext                = Optional help text string; should escape all raw
+;                           newlines so that xgettext parsing works
 ;
 ; */ <-- avoid gettext warnings
 

Modified: trunk/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/fc_version    (original)
+++ trunk/fc_version    Sun Oct  2 19:12:17 2016
@@ -56,7 +56,7 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Sep.27"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Oct.02"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""

Modified: trunk/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/ruleset.c?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/server/ruleset.c      (original)
+++ trunk/server/ruleset.c      Sun Oct  2 19:12:17 2016
@@ -6615,6 +6615,8 @@
           }
         }
         free(slist);
+
+        pgood->helptext = lookup_strvec(file, sec_name, "helptext");
       } goods_type_iterate_end;
     }
   }
@@ -7268,6 +7270,8 @@
     packet.to_pct = g->to_pct;
     packet.flags = g->flags;
 
+    PACKET_STRVEC_COMPUTE(packet.helptext, g->helptext);
+
     lsend_packet_ruleset_goods(dest, &packet);
   } goods_type_iterate_end;
 }

Modified: trunk/tools/ruleutil/rulesave.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleutil/rulesave.c?rev=33963&r1=33962&r2=33963&view=diff
==============================================================================
--- trunk/tools/ruleutil/rulesave.c     (original)
+++ trunk/tools/ruleutil/rulesave.c     Sun Oct  2 19:12:17 2016
@@ -1262,6 +1262,8 @@
       secfile_insert_str_vec(sfile, flag_names, set_count,
                              "%s.flags", path);
     }
+
+    save_strvec(sfile, pgood->helptext, path, "helptext");
   } goods_active_type_iterate_end;
 
   locks = FALSE;


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

Reply via email to