From fe3ad2f0e08247a251e99fb956da37d3dd06384a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 4 Oct 2021 05:29:17 +0300 Subject: [PATCH 52/52] Rulesave: Save comment about culture history_interest_pml settings See osdn #42984 Signed-off-by: Marko Lindqvist --- data/ruledit/comments-3.2.txt | 6 ++++++ tools/ruleutil/comments.c | 12 ++++++++++++ tools/ruleutil/comments.h | 1 + tools/ruleutil/rulesave.c | 3 +++ 4 files changed, 22 insertions(+) diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index f41650371f..4cb940627e 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -1377,3 +1377,9 @@ free_tech_method = "\n\ ; \"Random\" - Random researchable tech\n\ ; \"Cheapest\" - Cheapest researchable tech, random among equal cost ones\ " + +history_interest_pml = "\n\ +; How much existing history grows each turn. This makes older history\n\ +; of the same original value more valuable as newer history, as it has\n\ +; gained more interest.\ +" diff --git a/tools/ruleutil/comments.c b/tools/ruleutil/comments.c index ea11231564..9f37b39547 100644 --- a/tools/ruleutil/comments.c +++ b/tools/ruleutil/comments.c @@ -71,6 +71,7 @@ static struct { char *research_tech_leakage; char *research_upkeep_style; char *research_free_tech_method; + char *culture_history_interest; } comments_storage; /**********************************************************************//** @@ -182,6 +183,8 @@ bool comments_load(void) "entrydoc.tech_upkeep_style"); comment_load(comments_storage.research_free_tech_method, comment_file, "entrydoc.free_tech_method"); + comment_load(comments_storage.culture_history_interest, comment_file, + "entrydoc.history_interest_pml"); secfile_check_unused(comment_file); secfile_destroy(comment_file); @@ -603,3 +606,12 @@ void comment_research_free_tech_method(struct section_file *sfile) comment_entry_write(sfile, comments_storage.research_free_tech_method, "research"); } + +/**********************************************************************//** + Write culture history_interest_pml settings header. +**************************************************************************/ +void comment_culture_history_interest(struct section_file *sfile) +{ + comment_entry_write(sfile, comments_storage.culture_history_interest, + "culture"); +} diff --git a/tools/ruleutil/comments.h b/tools/ruleutil/comments.h index 4b88b42926..8fc997c90b 100644 --- a/tools/ruleutil/comments.h +++ b/tools/ruleutil/comments.h @@ -74,6 +74,7 @@ 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); void comment_research_free_tech_method(struct section_file *sfile); +void comment_culture_history_interest(struct section_file *sfile); #ifdef __cplusplus } diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 1f7ce1652e..7072500456 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1451,6 +1451,9 @@ static bool save_game_ruleset(const char *filename, const char *name) save_default_int(sfile, game.info.culture_migration_pml, RS_DEFAULT_CULTURE_MIGRATION_PML, "culture.migration_pml", NULL); + if (game.info.history_interest_pml != RS_DEFAULT_HISTORY_INTEREST_PML) { + comment_culture_history_interest(sfile); + } save_default_int(sfile, game.info.history_interest_pml, RS_DEFAULT_HISTORY_INTEREST_PML, "culture.history_interest_pml", NULL); -- 2.33.0