Author: cazfi
Date: Fri Jun 24 20:23:18 2016
New Revision: 33016

URL: http://svn.gna.org/viewcvs/freeciv?rev=33016&view=rev
Log:
Save documentation comment about 'effects' format to ruleset

See patch #7309

Modified:
    trunk/data/ruledit/comments.txt
    trunk/tools/ruleutil/comments.c
    trunk/tools/ruleutil/comments.h
    trunk/tools/ruleutil/rulesave.c

Modified: trunk/data/ruledit/comments.txt
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/ruledit/comments.txt?rev=33016&r1=33015&r2=33016&view=diff
==============================================================================
--- trunk/data/ruledit/comments.txt     (original)
+++ trunk/data/ruledit/comments.txt     Fri Jun 24 20:23:18 2016
@@ -765,3 +765,21 @@
 ;\n\
 ; */ <-- avoid gettext warnings\n\
 "
+
+effects = "\
+\n\
+; /* <-- avoid gettext warnings\n\
+;\n\
+; Effects\n\
+;\n\
+; type                    = What the effect does. Values of multiple active 
effects\n\
+;                           of the same type get summed for the total.\n\
+;                           See README.effects for list of possible types\n\
+; value                   = Value added for the effect type when this effect 
is active,\n\
+;                           i.e., all requirements are fulfilled\n\
+; multiplier              = Name of the policy that gives a multiplier for 
effect's value\n\
+; reqs                    = Requirements for the effect to be active.\n\
+;                           See README.effects for help on requirements\n\
+;\n\
+; */ <-- avoid gettext warnings\n\
+"

Modified: trunk/tools/ruleutil/comments.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleutil/comments.c?rev=33016&r1=33015&r2=33016&view=diff
==============================================================================
--- trunk/tools/ruleutil/comments.c     (original)
+++ trunk/tools/ruleutil/comments.c     Fri Jun 24 20:23:18 2016
@@ -35,6 +35,7 @@
   char *styles;
   char *citystyles;
   char *musicstyles;
+  char *effects;
 } comments_storage;
 
 /**************************************************************************
@@ -68,6 +69,7 @@
   comments_storage.styles = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.styles"));
   comments_storage.citystyles = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.citystyles"));
   comments_storage.musicstyles = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.musicstyles"));
+  comments_storage.effects = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.effects"));
 
   secfile_check_unused(comment_file);
   secfile_destroy(comment_file);
@@ -192,3 +194,11 @@
 {
   comment_write(sfile, comments_storage.musicstyles, "Music Styles");
 }
+
+/**************************************************************************
+  Write effects header.
+**************************************************************************/
+void comment_effects(struct section_file *sfile)
+{
+  comment_write(sfile, comments_storage.effects, "Effects");
+}

Modified: trunk/tools/ruleutil/comments.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleutil/comments.h?rev=33016&r1=33015&r2=33016&view=diff
==============================================================================
--- trunk/tools/ruleutil/comments.h     (original)
+++ trunk/tools/ruleutil/comments.h     Fri Jun 24 20:23:18 2016
@@ -35,6 +35,7 @@
 void comment_styles(struct section_file *sfile);
 void comment_citystyles(struct section_file *sfile);
 void comment_musicstyles(struct section_file *sfile);
+void comment_effects(struct section_file *sfile);
 
 #ifdef __cplusplus
 }

Modified: trunk/tools/ruleutil/rulesave.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleutil/rulesave.c?rev=33016&r1=33015&r2=33016&view=diff
==============================================================================
--- trunk/tools/ruleutil/rulesave.c     (original)
+++ trunk/tools/ruleutil/rulesave.c     Fri Jun 24 20:23:18 2016
@@ -716,6 +716,8 @@
 
   data.idx = 0;
   data.sfile = sfile;
+
+  comment_effects(sfile);
 
   if (!iterate_effect_cache(effect_save, &data)) {
     return FALSE;


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

Reply via email to