From 428d3b1ef74b76a6175f438775119401b39472cd Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 23 Apr 2021 03:22:39 +0300 Subject: [PATCH 53/53] Rulesave: Save comment about civstyle.gold_upkeep_style setting See osdn #42062 Signed-off-by: Marko Lindqvist --- data/alien/game.ruleset | 24 ++++++++++++------------ data/civ1/game.ruleset | 24 ++++++++++++------------ data/civ2/game.ruleset | 24 ++++++++++++------------ data/civ2civ3/game.ruleset | 24 ++++++++++++------------ data/classic/game.ruleset | 24 ++++++++++++------------ data/goldkeep/game.ruleset | 24 ++++++++++++------------ data/granularity/game.ruleset | 24 ++++++++++++------------ data/multiplayer/game.ruleset | 24 ++++++++++++------------ data/ruledit/comments-3.2.txt | 21 +++++++++++++++++++++ data/sandbox/game.ruleset | 24 ++++++++++++------------ data/stub/game.ruleset | 24 ++++++++++++------------ data/webperimental/game.ruleset | 24 ++++++++++++------------ tools/ruleutil/comments.c | 12 ++++++++++++ tools/ruleutil/comments.h | 1 + tools/ruleutil/rulesave.c | 3 +++ 15 files changed, 169 insertions(+), 132 deletions(-) diff --git a/data/alien/game.ruleset b/data/alien/game.ruleset index 2e90d4482e..0bbaa3de3b 100644 --- a/data/alien/game.ruleset +++ b/data/alien/game.ruleset @@ -159,18 +159,18 @@ gameloss_style = "" paradrop_to_transport = FALSE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/civ1/game.ruleset b/data/civ1/game.ruleset index ebbb1112e6..0f45af24f8 100644 --- a/data/civ1/game.ruleset +++ b/data/civ1/game.ruleset @@ -145,18 +145,18 @@ gameloss_style = "" paradrop_to_transport = FALSE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/civ2/game.ruleset b/data/civ2/game.ruleset index 717a720c32..a4bd51606c 100644 --- a/data/civ2/game.ruleset +++ b/data/civ2/game.ruleset @@ -141,18 +141,18 @@ gameloss_style = "" paradrop_to_transport = FALSE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/civ2civ3/game.ruleset b/data/civ2civ3/game.ruleset index 799d8958a3..0b563f59b3 100644 --- a/data/civ2civ3/game.ruleset +++ b/data/civ2civ3/game.ruleset @@ -162,18 +162,18 @@ gameloss_style = "" paradrop_to_transport = FALSE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/classic/game.ruleset b/data/classic/game.ruleset index 153dc28177..ab9e202eb7 100644 --- a/data/classic/game.ruleset +++ b/data/classic/game.ruleset @@ -155,18 +155,18 @@ gameloss_style = "" paradrop_to_transport = FALSE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/goldkeep/game.ruleset b/data/goldkeep/game.ruleset index 5efc03da03..b7bc02dcc8 100644 --- a/data/goldkeep/game.ruleset +++ b/data/goldkeep/game.ruleset @@ -160,18 +160,18 @@ gameloss_style = "" paradrop_to_transport = TRUE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/granularity/game.ruleset b/data/granularity/game.ruleset index b0e84af80d..b606e635c2 100644 --- a/data/granularity/game.ruleset +++ b/data/granularity/game.ruleset @@ -151,18 +151,18 @@ gameloss_style = "" paradrop_to_transport = FALSE ;Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/multiplayer/game.ruleset b/data/multiplayer/game.ruleset index 8667fd3e0c..ee29bd774a 100644 --- a/data/multiplayer/game.ruleset +++ b/data/multiplayer/game.ruleset @@ -158,18 +158,18 @@ gameloss_style = "" paradrop_to_transport = FALSE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index 7ad71aa60b..106713bb86 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -1211,3 +1211,24 @@ gameloss_style = "\n\ ; \"Loot\" - Player who killed the gameloss unit gets loot:\n\ ; Partial map, gold, techs, cities\ " + +gold_upkeep_style = "\n\ +; Method of paying unit and improvement gold upkeep\n\ +; \"City\" - The player`s total gold must be non-negative after paying upkeep\n\ +; costs associated with each city. If for any city the player`s\n\ +; gold is negative, random buildings in the city are sold off. If\n\ +; the gold is still negative, then supported units with gold upkeep\n\ +; are disbanded.\n\ +; \"Mixed\" - In the first step, the player`s total gold must be non-negative\n\ +; after paying upkeep for all buildings within a city. If for any\n\ +; city the player`s gold is negative, random buildings in the city\n\ +; are sold off.\n\ +; In the second step, gold upkeep for all units is paid in a lump\n\ +; sum. If the player does not have enough gold, random units with\n\ +; gold upkeep are disbanded.\n\ +; \"Nation\" - Gold upkeep for all buildings and units is paid in a lump sum\n\ +; after all cities have been processed. If the player does not\n\ +; have enough gold, random buildings from random cities are sold.\n\ +; If still more gold is needed, then random units with gold\n\ +; upkeep are disbanded.\ +" diff --git a/data/sandbox/game.ruleset b/data/sandbox/game.ruleset index ce1fc56eb3..9c04611f31 100644 --- a/data/sandbox/game.ruleset +++ b/data/sandbox/game.ruleset @@ -160,18 +160,18 @@ gameloss_style = "" paradrop_to_transport = TRUE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/stub/game.ruleset b/data/stub/game.ruleset index 8adb214cd3..fd946c4d62 100644 --- a/data/stub/game.ruleset +++ b/data/stub/game.ruleset @@ -143,18 +143,18 @@ gameloss_style = "" paradrop_to_transport = FALSE ;Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/data/webperimental/game.ruleset b/data/webperimental/game.ruleset index ef946efe1f..a0001663f2 100644 --- a/data/webperimental/game.ruleset +++ b/data/webperimental/game.ruleset @@ -159,18 +159,18 @@ gameloss_style = "Barbarians", "Loot" paradrop_to_transport = FALSE ; Method of paying unit and improvement gold upkeep -; "City" - The player`s total gold must be non-negative after paying upkeep -; costs associated with each city. If for any city the player`s -; gold is negative, random buildings in the city are sold off. If -; the gold is still negative, then supported units with gold upkeep -; are disbanded. -; "Mixed" - In the first step, the player`s total gold must be non-negative -; after paying upkeep for all buildings within a city. If for any -; city the player`s gold is negative, random buildings in the city -; are sold off. -; In the second step, gold upkeep for all units is paid in a lump -; sum. If the player does not have enough gold, random units with -; gold upkeep are disbanded. +; "City" - The player`s total gold must be non-negative after paying upkeep +; costs associated with each city. If for any city the player`s +; gold is negative, random buildings in the city are sold off. If +; the gold is still negative, then supported units with gold upkeep +; are disbanded. +; "Mixed" - In the first step, the player`s total gold must be non-negative +; after paying upkeep for all buildings within a city. If for any +; city the player`s gold is negative, random buildings in the city +; are sold off. +; In the second step, gold upkeep for all units is paid in a lump +; sum. If the player does not have enough gold, random units with +; gold upkeep are disbanded. ; "Nation" - Gold upkeep for all buildings and units is paid in a lump sum ; after all cities have been processed. If the player does not ; have enough gold, random buildings from random cities are sold. diff --git a/tools/ruleutil/comments.c b/tools/ruleutil/comments.c index dcb53b6573..c84f815e4f 100644 --- a/tools/ruleutil/comments.c +++ b/tools/ruleutil/comments.c @@ -54,6 +54,7 @@ static struct { /* Comment entries */ char *civstyle_granary; char *civstyle_gameloss_style; + char *civstyle_gold_upkeep_style; } comments_storage; /**********************************************************************//** @@ -129,6 +130,8 @@ bool comments_load(void) "entrydoc.granary"); comment_load(comments_storage.civstyle_gameloss_style, comment_file, "entrydoc.gameloss_style"); + comment_load(comments_storage.civstyle_gold_upkeep_style, comment_file, + "entrydoc.gold_upkeep_style"); secfile_check_unused(comment_file); secfile_destroy(comment_file); @@ -397,3 +400,12 @@ void comment_civstyle_gameloss_style(struct section_file *sfile) comment_entry_write(sfile, comments_storage.civstyle_gameloss_style, "civstyle"); } + +/**********************************************************************//** + Write civstyle gold_upkeep_style settings header. +**************************************************************************/ +void comment_civstyle_gold_upkeep_style(struct section_file *sfile) +{ + comment_entry_write(sfile, comments_storage.civstyle_gold_upkeep_style, + "civstyle"); +} diff --git a/tools/ruleutil/comments.h b/tools/ruleutil/comments.h index 317f9350b7..71159abe33 100644 --- a/tools/ruleutil/comments.h +++ b/tools/ruleutil/comments.h @@ -57,6 +57,7 @@ void comment_clauses(struct section_file *sfile); /* Entry comments */ 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); #ifdef __cplusplus } diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 99ce21cf08..c7af90a2f8 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1209,6 +1209,9 @@ static bool save_game_ruleset(const char *filename, const char *name) save_default_int(sfile, game.info.init_city_radius_sq, RS_DEFAULT_CITY_RADIUS_SQ, "civstyle.init_city_radius_sq", NULL); + + comment_civstyle_gold_upkeep_style(sfile); + if (0 != fc_strcasecmp(gold_upkeep_style_name(game.info.gold_upkeep_style), RS_DEFAULT_GOLD_UPKEEP_STYLE)) { secfile_insert_str(sfile, -- 2.30.2