From 7246e2410df0aa3fc092085540c0ce25eb45392b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 4 Nov 2021 05:04:35 +0200 Subject: [PATCH 44/44] Rulesave: Save comment about actions quiet_actions settings See osdn #43162 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 | 2 ++ 4 files changed, 22 insertions(+) diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index 80801a1ef8..4c690a8e25 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -1321,6 +1321,13 @@ dc_initial_odds = "\n\ ; Action_Odds_Pct effect before the roll happens.\n\ " +quiet_actions = "\n\ +; Suppress automatic help text generation about what enables and/or\n\ +; disables the following actions.\n\ +;\n\ +; Can make the help text less redundant when you document it your self.\ +" + radius_permanent = "\n\ ; Difference between city workable area and area permanently claimed by\n\ ; city (these tiles cannot be stolen by stronger border sources).\n\ diff --git a/tools/ruleutil/comments.c b/tools/ruleutil/comments.c index be4dd4cd28..92a99576bb 100644 --- a/tools/ruleutil/comments.c +++ b/tools/ruleutil/comments.c @@ -67,6 +67,7 @@ static struct { char *auto_attack; char *actions_ui_names; char *actions_dc_initial_odds; + char *actions_quiet_actions; char *borders_radius_permanent; char *research_tech_cost_style; char *research_base_tech_cost; @@ -179,6 +180,8 @@ bool comments_load(void) "entrydoc.ui_names"); comment_load(comments_storage.actions_dc_initial_odds, comment_file, "entrydoc.dc_initial_odds"); + comment_load(comments_storage.actions_quiet_actions, comment_file, + "entrydoc.quiet_actions"); comment_load(comments_storage.borders_radius_permanent, comment_file, "entrydoc.radius_permanent"); comment_load(comments_storage.research_tech_cost_style, comment_file, @@ -585,6 +588,15 @@ void comment_actions_dc_initial_odds(struct section_file *sfile) "actions"); } +/**********************************************************************//** + Write actions quiet_actions settings header. +**************************************************************************/ +void comment_actions_quiet_actions(struct section_file *sfile) +{ + comment_entry_write(sfile, comments_storage.actions_quiet_actions, + "actions"); +} + /**********************************************************************//** Write borders radius_sq_city_permanent settings header. **************************************************************************/ diff --git a/tools/ruleutil/comments.h b/tools/ruleutil/comments.h index e9bf9c246b..b2d314e409 100644 --- a/tools/ruleutil/comments.h +++ b/tools/ruleutil/comments.h @@ -70,6 +70,7 @@ void comment_combat_rules_nuke_defender_survival(struct section_file *sfile); void comment_auto_attack(struct section_file *sfile); void comment_actions_ui_names(struct section_file *sfile); void comment_actions_dc_initial_odds(struct section_file *sfile); +void comment_actions_quiet_actions(struct section_file *sfile); 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); diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 4420271592..e9bc3773a9 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1348,6 +1348,8 @@ static bool save_game_ruleset(const char *filename, const char *name) save_action_blocked_by(sfile, act); } action_iterate_end; + comment_actions_quiet_actions(sfile); + i = 0; action_iterate(act) { if (action_by_number(act)->quiet) { -- 2.33.0