Author: cazfi
Date: Thu Jun 23 08:14:22 2016
New Revision: 32980

URL: http://svn.gna.org/viewcvs/freeciv?rev=32980&view=rev
Log:
Save styles.ruleset comments.

See patch #7296

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=32980&r1=32979&r2=32980&view=diff
==============================================================================
--- trunk/data/ruledit/comments.txt     (original)
+++ trunk/data/ruledit/comments.txt     Thu Jun 23 08:14:22 2016
@@ -715,3 +715,53 @@
 ;\n\
 ; */ <-- avoid gettext warnings\n\
 "
+
+styles = "\
+\n\
+; /* <-- avoid gettext warnings\n\
+;\n\
+; Nation styles\n\
+;\n\
+; name          = translatable name as seen by user\n\
+; rule_name     = (optional) name for rulesets; if not\n\
+;                 present, 'name' is used.\n\
+;\n\
+; */ <-- avoid gettext warnings\n\
+"
+
+citystyles = "\
+\n\
+; /* <-- avoid gettext warnings\n\
+;\n\
+; City styles define the way cities are drawn\n\
+;\n\
+; name             = translatable name as seen by user\n\
+; rule_name        = (optional) name for savegames, rulesets etc; if not\n\
+;                    present, 'name' is used. Since the name used in 
savegames\n\
+;                    must not change, use this when renaming a city style 
after a\n\
+;                    ruleset has been released.\n\
+; graphic          = group of tiles to use, see cities spec for\n\
+;                    more info on city tiles\n\
+; citizens_graphic = group of citizens tiles to use, see citizens/small\n\
+;                    spec for more info on citizens tiles\n\
+; reqs             = requirements for this city style (see README.effects)\n\
+;\n\
+; */ <-- avoid gettext warnings\n\
+"
+
+musicstyles = "\
+\n\
+; /* <-- avoid gettext warnings\n\
+;\n\
+; Music styles\n\
+;\n\
+; Order is important. The last one for which activation requirements\n\
+; are fulfilled is the one that plays.\n\
+;\n\
+; music_peaceful = Music to play when nation in peaceful mood\n\
+; music_combat   = Music to play when nation in combat mood\n\
+; reqs          = requirements to activate the style (see effects.ruleset\n\
+;                 and 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=32980&r1=32979&r2=32980&view=diff
==============================================================================
--- trunk/tools/ruleutil/comments.c     (original)
+++ trunk/tools/ruleutil/comments.c     Thu Jun 23 08:14:22 2016
@@ -32,6 +32,9 @@
   char *utypes;
   char *terrains;
   char *extras;
+  char *styles;
+  char *citystyles;
+  char *musicstyles;
 } comments_storage;
 
 /**************************************************************************
@@ -62,6 +65,9 @@
   comments_storage.utypes = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.utypes"));
   comments_storage.terrains = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.terrains"));
   comments_storage.extras = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.extras"));
+  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"));
 
   secfile_check_unused(comment_file);
   secfile_destroy(comment_file);
@@ -162,3 +168,27 @@
 {
   comment_write(sfile, comments_storage.extras, "Extras");
 }
+
+/**************************************************************************
+  Write styles header.
+**************************************************************************/
+void comment_styles(struct section_file *sfile)
+{
+  comment_write(sfile, comments_storage.styles, "Styles");
+}
+
+/**************************************************************************
+  Write city styles header.
+**************************************************************************/
+void comment_citystyles(struct section_file *sfile)
+{
+  comment_write(sfile, comments_storage.citystyles, "City Styles");
+}
+
+/**************************************************************************
+  Write music styles header.
+**************************************************************************/
+void comment_musicstyles(struct section_file *sfile)
+{
+  comment_write(sfile, comments_storage.musicstyles, "Music Styles");
+}

Modified: trunk/tools/ruleutil/comments.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleutil/comments.h?rev=32980&r1=32979&r2=32980&view=diff
==============================================================================
--- trunk/tools/ruleutil/comments.h     (original)
+++ trunk/tools/ruleutil/comments.h     Thu Jun 23 08:14:22 2016
@@ -32,6 +32,9 @@
 void comment_utypes(struct section_file *sfile);
 void comment_terrains(struct section_file *sfile);
 void comment_extras(struct section_file *sfile);
+void comment_styles(struct section_file *sfile);
+void comment_citystyles(struct section_file *sfile);
+void comment_musicstyles(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=32980&r1=32979&r2=32980&view=diff
==============================================================================
--- trunk/tools/ruleutil/rulesave.c     (original)
+++ trunk/tools/ruleutil/rulesave.c     Thu Jun 23 08:14:22 2016
@@ -452,6 +452,8 @@
     return FALSE;
   }
 
+  comment_styles(sfile);
+
   sect_idx = 0;
   styles_iterate(pstyle) {
     char path[512];
@@ -460,6 +462,8 @@
 
     save_name_translation(sfile, &(pstyle->name), path);
   } styles_iterate_end;
+
+  comment_citystyles(sfile);
 
   sect_idx = 0;
   for (i = 0; i < game.control.styles_count; i++) {
@@ -482,6 +486,8 @@
 
     save_reqs_vector(sfile, &(city_styles[i].reqs), path, "reqs");
   }
+
+  comment_musicstyles(sfile);
 
   sect_idx = 0;
   music_styles_iterate(pmus) {


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

Reply via email to