From 6a8fc269f745927fbe66cbe304e2107967523038 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 23 Sep 2021 06:45:20 +0300 Subject: [PATCH 34/34] Rulesave: Save comment about research tech_upkeep_style settings See osdn #42903 Signed-off-by: Marko Lindqvist --- data/ruledit/comments-3.2.txt | 8 ++++++++ tools/ruleutil/comments.c | 12 ++++++++++++ tools/ruleutil/comments.h | 1 + tools/ruleutil/rulesave.c | 1 + 4 files changed, 22 insertions(+) diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index b6bcc5914e..47bb9f9b77 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -1362,3 +1362,11 @@ tech_leakage = "\n\ ; normal players (human and AI) which already know the\n\ ; tech.\ " + +tech_upkeep_style = "\n\ +; Method of paying tech upkeep\n\ +; \"None\" - no upkeep\n\ +; \"Basic\" - upkeep is calculated as:\n\ +; / tech_upkeep_divider - tech_upkeep_free\n\ +; \"Cities\" - upkeep is calculated like \"Basic\", but multiplied by number of cities\ +" diff --git a/tools/ruleutil/comments.c b/tools/ruleutil/comments.c index ba4f338209..c1e8b10007 100644 --- a/tools/ruleutil/comments.c +++ b/tools/ruleutil/comments.c @@ -69,6 +69,7 @@ static struct { char *research_tech_cost_style; char *research_base_tech_cost; char *research_tech_leakage; + char *research_upkeep_style; } comments_storage; /**********************************************************************//** @@ -176,6 +177,8 @@ bool comments_load(void) "entrydoc.base_tech_cost"); comment_load(comments_storage.research_tech_leakage, comment_file, "entrydoc.tech_leakage"); + comment_load(comments_storage.research_upkeep_style, comment_file, + "entrydoc.tech_upkeep_style"); secfile_check_unused(comment_file); secfile_destroy(comment_file); @@ -579,3 +582,12 @@ void comment_research_tech_leakage(struct section_file *sfile) comment_entry_write(sfile, comments_storage.research_tech_leakage, "research"); } + +/**********************************************************************//** + Write research tech_upkeep_style settings header. +**************************************************************************/ +void comment_research_upkeep_style(struct section_file *sfile) +{ + comment_entry_write(sfile, comments_storage.research_upkeep_style, + "research"); +} diff --git a/tools/ruleutil/comments.h b/tools/ruleutil/comments.h index d7ea3e5998..213745ecd4 100644 --- a/tools/ruleutil/comments.h +++ b/tools/ruleutil/comments.h @@ -72,6 +72,7 @@ void comment_borders_radius_permanent(struct section_file *sfile); void comment_research_tech_cost_style(struct section_file *sfile); void comment_research_base_tech_cost(struct section_file *sfile); void comment_research_tech_leakage(struct section_file *sfile); +void comment_research_upkeep_style(struct section_file *sfile); #ifdef __cplusplus } diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 7599c31900..ad3752d1b4 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1432,6 +1432,7 @@ static bool save_game_ruleset(const char *filename, const char *name) comment_research_tech_leakage(sfile); secfile_insert_str(sfile, tech_leakage_style_name(game.info.tech_leakage), "research.tech_leakage"); + comment_research_upkeep_style(sfile); secfile_insert_str(sfile, tech_upkeep_style_name(game.info.tech_upkeep_style), "research.tech_upkeep_style"); save_default_int(sfile, game.info.tech_upkeep_divider, -- 2.33.0