Author: cazfi
Date: Sun Jun 26 09:35:09 2016
New Revision: 33033

URL: http://svn.gna.org/viewcvs/freeciv?rev=33033&view=rev
Log:
Save documentation comment about action enablers, disasters, achievements,
and goods to the ruleset.

See patch #7320

Modified:
    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/tools/ruleutil/comments.c
    trunk/tools/ruleutil/comments.h
    trunk/tools/ruleutil/rulesave.c

Modified: trunk/data/alien/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/game.ruleset?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/alien/game.ruleset       (original)
+++ trunk/data/alien/game.ruleset       Sun Jun 26 09:35:09 2016
@@ -300,6 +300,7 @@
 ; satisfied.
 ;
 ; */ <-- avoid gettext warnings
+
 [actionenabler_sabotage_city]
 action = "Sabotage City"
 actor_reqs    =
@@ -737,7 +738,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/data/civ1/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/game.ruleset?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/civ1/game.ruleset        (original)
+++ trunk/data/civ1/game.ruleset        Sun Jun 26 09:35:09 2016
@@ -272,6 +272,7 @@
 ; satisfied.
 ;
 ; */ <-- avoid gettext warnings
+
 [actionenabler_sabotage_city]
 action = "Sabotage City"
 actor_reqs    =
@@ -735,7 +736,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/data/civ2/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/game.ruleset?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/civ2/game.ruleset        (original)
+++ trunk/data/civ2/game.ruleset        Sun Jun 26 09:35:09 2016
@@ -304,6 +304,7 @@
 ; satisfied.
 ;
 ; */ <-- avoid gettext warnings
+
 [actionenabler_sabotage_city]
 action = "Sabotage City"
 actor_reqs    =
@@ -767,7 +768,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/data/civ2civ3/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/game.ruleset?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/civ2civ3/game.ruleset    (original)
+++ trunk/data/civ2civ3/game.ruleset    Sun Jun 26 09:35:09 2016
@@ -316,6 +316,7 @@
 ; satisfied.
 ;
 ; */ <-- avoid gettext warnings
+
 [actionenabler_sabotage_city]
 action = "Sabotage City"
 actor_reqs    =
@@ -919,7 +920,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/data/classic/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/game.ruleset?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/classic/game.ruleset     (original)
+++ trunk/data/classic/game.ruleset     Sun Jun 26 09:35:09 2016
@@ -305,6 +305,7 @@
 ; satisfied.
 ;
 ; */ <-- avoid gettext warnings
+
 [actionenabler_sabotage_city]
 action = "Sabotage City"
 actor_reqs    =
@@ -801,7 +802,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/data/experimental/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/game.ruleset?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/experimental/game.ruleset        (original)
+++ trunk/data/experimental/game.ruleset        Sun Jun 26 09:35:09 2016
@@ -308,6 +308,7 @@
 ; satisfied.
 ;
 ; */ <-- avoid gettext warnings
+
 [actionenabler_sabotage_city]
 action = "Sabotage City"
 actor_reqs    =
@@ -830,7 +831,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/data/multiplayer/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/game.ruleset?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/multiplayer/game.ruleset (original)
+++ trunk/data/multiplayer/game.ruleset Sun Jun 26 09:35:09 2016
@@ -302,6 +302,7 @@
 ; satisfied.
 ;
 ; */ <-- avoid gettext warnings
+
 [actionenabler_sabotage_city]
 action = "Sabotage City"
 actor_reqs    =
@@ -753,7 +754,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/data/ruledit/comments.txt
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/ruledit/comments.txt?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/ruledit/comments.txt     (original)
+++ trunk/data/ruledit/comments.txt     Sun Jun 26 09:35:09 2016
@@ -783,3 +783,86 @@
 ;\n\
 ; */ <-- avoid gettext warnings\n\
 "
+
+disasters = "\
+\n\
+; /* <-- avoid gettext warnings\n\
+;\n\
+; Disaster types:\n\
+;\n\
+; name                    = translatable name as seen by user\n\
+; reqs                    = requirements for disaster to happen (see 
effects.ruleset\n\
+;                           and README.effects for help on requirements)\n\
+; frequency               = how likely disaster is to occur\n\
+; effects\n\
+;   - \"DestroyBuilding\"   = Random building is destroyed\n\
+;   - \"ReducePopulation\"  = Reduce city size by one unless it's already 1\n\
+;   - \"ReducePopDestroy\"  = Reduce city size by one, possibly destroying the 
city\n\
+;   - \"EmptyFoodStock\"    = Remove all food from food stock\n\
+;   - \"EmptyProdStock\"    = Destroy current production\n\
+;   - \"Pollution\"         = One tile surrounding city polluted\n\
+;   - \"Fallout\"           = One tile surrounding city polluted with 
fallout\n\
+;\n\
+; */ <-- avoid gettext warnings\n\
+"
+
+achievements = "\
+\n\
+; /* <-- avoid gettext warnings\n\
+;\n\
+; Achievement types:\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\n\
+;                           savegames must not change, use this when renaming 
a\n\
+;                           achievement after a ruleset has been released.\n\
+; type                    = What event grants the achievement to player.\n\
+;                           See README.achievements for list of these types.\n\
+; unique                  = If TRUE, only first one reaching the achievement 
will\n\
+;                           get it. Defaults to TRUE.\n\
+; value                   = Value to reach. Exact meaning of this depends on\n\
+;                           achievement type.\n\
+; culture                 = Amount of culture granted to player who gets 
achievement\n\
+;                           granted.\n\
+; first_msg               = Message shown to first player gaining the 
achievement\n\
+; cons_msg                = Message shown to consecutive players gaining the 
achievement\n\
+;\n\
+; */ <-- avoid gettext warnings\n\
+"
+
+goods = "\
+\n\
+; /* <-- avoid gettext warnings\n\
+;\n\
+; Goods types:\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\n\
+;                           savegames must not change, use this when 
renaming\n\
+;                           an good after a ruleset has been released.\n\
+; reqs                    = requirements for a city to provide goods (see 
effects.ruleset\n\
+;                           and README.effects for help on requirements)\n\
+;\n\
+; */ <-- avoid gettext warnings\n\
+"
+
+enablers = "\
+\n\
+; /* <-- avoid gettext warnings\n\
+;\n\
+; Action enablers:\n\
+;\n\
+; action               = the action to enable.\n\
+; actor_reqs           = requirements that apply to the actor.\n\
+; target_reqs          = requirements that apply to the target.\n\
+;\n\
+; README.actions lists the possible actions and their hard coded\n\
+; requirements.\n\
+;\n\
+; An action enabler is active when its actor_reqs AND its target_reqs are\n\
+; satisfied.\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=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/sandbox/game.ruleset     (original)
+++ trunk/data/sandbox/game.ruleset     Sun Jun 26 09:35:09 2016
@@ -319,6 +319,7 @@
 ; satisfied.
 ;
 ; */ <-- avoid gettext warnings
+
 [actionenabler_sabotage_city]
 action = "Sabotage City"
 actor_reqs    =
@@ -1002,7 +1003,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/data/stub/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/stub/game.ruleset?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/data/stub/game.ruleset        (original)
+++ trunk/data/stub/game.ruleset        Sun Jun 26 09:35:09 2016
@@ -224,15 +224,15 @@
 ;
 ; */ <-- avoid gettext warnings
 
-; Suppress automatic help text generation about what enables and/or
-; disables the following actions.
-;
-; Can make the help text less redundant when you document it your self.
-;quiet_actions = "Targeted Sabotage City", "Targeted Steal Tech"
-
 ; No enabled actions
 ; [actionenabler_embassy]
 ; action = "Establish Embassy"
+
+; Suppress automatic help text generation about what enables and/or
+; disables the following actions.
+;
+; Can make the help text less redundant when you document it your self.
+;quiet_actions = "Targeted Sabotage City", "Targeted Steal Tech"
 
 [borders]
 ; Base border radius from city.
@@ -431,7 +431,7 @@
 
 ; /* <-- avoid gettext warnings
 ;
-; Goods
+; Goods types:
 ;
 ; name                    = translatable name as seen by user
 ; rule_name               = (optional) name for savegames, rulesets etc; if not

Modified: trunk/tools/ruleutil/comments.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleutil/comments.c?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/tools/ruleutil/comments.c     (original)
+++ trunk/tools/ruleutil/comments.c     Sun Jun 26 09:35:09 2016
@@ -36,6 +36,10 @@
   char *citystyles;
   char *musicstyles;
   char *effects;
+  char *disasters;
+  char *achievements;
+  char *goods;
+  char *enablers;
 } comments_storage;
 
 /**************************************************************************
@@ -70,6 +74,11 @@
   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"));
+  comments_storage.disasters = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.disasters"));
+  comments_storage.achievements = fc_strdup(secfile_lookup_str(comment_file,
+                                                               
"typedoc.achievements"));
+  comments_storage.goods = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.goods"));
+  comments_storage.enablers = fc_strdup(secfile_lookup_str(comment_file, 
"typedoc.enablers"));
 
   secfile_check_unused(comment_file);
   secfile_destroy(comment_file);
@@ -202,3 +211,35 @@
 {
   comment_write(sfile, comments_storage.effects, "Effects");
 }
+
+/**************************************************************************
+  Write disasters header.
+**************************************************************************/
+void comment_disasters(struct section_file *sfile)
+{
+  comment_write(sfile, comments_storage.disasters, "Disasters");
+}
+
+/**************************************************************************
+  Write achievements header.
+**************************************************************************/
+void comment_achievements(struct section_file *sfile)
+{
+  comment_write(sfile, comments_storage.achievements, "Achievements");
+}
+
+/**************************************************************************
+  Write goods header.
+**************************************************************************/
+void comment_goods(struct section_file *sfile)
+{
+  comment_write(sfile, comments_storage.goods, "Goods");
+}
+
+/**************************************************************************
+  Write action enablers header.
+**************************************************************************/
+void comment_enablers(struct section_file *sfile)
+{
+  comment_write(sfile, comments_storage.enablers, "Action Enablers");
+}

Modified: trunk/tools/ruleutil/comments.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleutil/comments.h?rev=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/tools/ruleutil/comments.h     (original)
+++ trunk/tools/ruleutil/comments.h     Sun Jun 26 09:35:09 2016
@@ -36,6 +36,10 @@
 void comment_citystyles(struct section_file *sfile);
 void comment_musicstyles(struct section_file *sfile);
 void comment_effects(struct section_file *sfile);
+void comment_disasters(struct section_file *sfile);
+void comment_achievements(struct section_file *sfile);
+void comment_goods(struct section_file *sfile);
+void comment_enablers(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=33033&r1=33032&r2=33033&view=diff
==============================================================================
--- trunk/tools/ruleutil/rulesave.c     (original)
+++ trunk/tools/ruleutil/rulesave.c     Sun Jun 26 09:35:09 2016
@@ -1043,6 +1043,7 @@
     return FALSE;
   }
 
+  comment_enablers(sfile);
   sect_idx = 0;
   action_enablers_iterate(pae) {
     char path[512];
@@ -1129,6 +1130,8 @@
 
   /* TODO: Team names */
 
+  comment_disasters(sfile);
+
   sect_idx = 0;
   disaster_type_iterate(pd) {
     char path[512];
@@ -1158,6 +1161,8 @@
                              "%s.effects", path);
     }
   } disaster_type_iterate_end;
+
+  comment_achievements(sfile);
 
   sect_idx = 0;
   achievements_iterate(pach) {
@@ -1207,7 +1212,9 @@
   }
 
   /* Goods */
-  set_count = 0;
+  comment_goods(sfile);
+
+  sect_idx = 0;
   goods_type_iterate(pgood) {
     char path[512];
 


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

Reply via email to