From db1538da26f2c0b7b0e81c7b964cdfe32f0a58ac Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 11 May 2021 18:47:21 +0300 Subject: [PATCH 56/56] Rulesave: Save comment about wonder_visibility.small_wonders See osdn #42238 Signed-off-by: Marko Lindqvist --- data/ruledit/comments-3.2.txt | 7 +++++++ tools/ruleutil/comments.c | 12 ++++++++++++ tools/ruleutil/comments.h | 1 + tools/ruleutil/rulesave.c | 1 + 4 files changed, 21 insertions(+) diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index 2fb7853178..06be53fcba 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -1233,6 +1233,13 @@ gold_upkeep_style = "\n\ ; upkeep are disbanded.\ " +wv_small_wonders = "\ +; When do opponents know which city, if any, has built the Small Wonder\n\ +; \"Always\" - Information is always sent\n\ +; \"Never\" - Information is never sent\n\ +; \"Embassy\" - Information is sent when team has an embassy with Wonder owner\ +" + tired_attack = "\ ; If tired_attack is set to TRUE, units that attack with less than a single\n\ ; move point (per move_fragments in terrain.ruleset) will have their attack\n\ diff --git a/tools/ruleutil/comments.c b/tools/ruleutil/comments.c index a194505965..8701b2fe98 100644 --- a/tools/ruleutil/comments.c +++ b/tools/ruleutil/comments.c @@ -55,6 +55,7 @@ static struct { char *civstyle_granary; char *civstyle_gameloss_style; char *civstyle_gold_upkeep_style; + char *wonder_visibility_small_wonders; char *combat_rules_tired_attack; char *combat_rules_only_killing_veteran; char *combat_rules_nuke_pop_loss; @@ -136,6 +137,8 @@ bool comments_load(void) "entrydoc.gameloss_style"); comment_load(comments_storage.civstyle_gold_upkeep_style, comment_file, "entrydoc.gold_upkeep_style"); + comment_load(comments_storage.wonder_visibility_small_wonders, comment_file, + "entrydoc.wv_small_wonders"); comment_load(comments_storage.combat_rules_tired_attack, comment_file, "entrydoc.tired_attack"); comment_load(comments_storage.combat_rules_only_killing_veteran, comment_file, @@ -423,6 +426,15 @@ void comment_civstyle_gold_upkeep_style(struct section_file *sfile) "civstyle"); } +/**********************************************************************//** + Write wonder_visibility small_wonders settings header. +**************************************************************************/ +void comment_wonder_visibility_small_wonders(struct section_file *sfile) +{ + comment_entry_write(sfile, comments_storage.wonder_visibility_small_wonders, + "wonder_visibility"); +} + /**********************************************************************//** Write combat_rules tired_attack settings header. **************************************************************************/ diff --git a/tools/ruleutil/comments.h b/tools/ruleutil/comments.h index ee5307b2f7..62a8399ee9 100644 --- a/tools/ruleutil/comments.h +++ b/tools/ruleutil/comments.h @@ -58,6 +58,7 @@ void comment_clauses(struct section_file *sfile); void comment_civstyle_granary(struct section_file *sfile); void comment_civstyle_gameloss_style(struct section_file *sfile); void comment_civstyle_gold_upkeep_style(struct section_file *sfile); +void comment_wonder_visibility_small_wonders(struct section_file *sfile); void comment_combat_rules_tired_attack(struct section_file *sfile); void comment_combat_rules_only_killing_veteran(struct section_file *sfile); void comment_combat_rules_nuke_pop_loss(struct section_file *sfile); diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 7f0dc15bdf..1b7445f710 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1227,6 +1227,7 @@ static bool save_game_ruleset(const char *filename, const char *name) if (fc_strcasecmp(wonder_visib_type_name(game.info.small_wonder_visibility), RS_DEFAULT_SMALL_WONDER_VISIBILITY)) { + comment_wonder_visibility_small_wonders(sfile); secfile_insert_str(sfile, wonder_visib_type_name(game.info.small_wonder_visibility), "wonder_visibility.small_wonders"); -- 2.30.2