Project

General

Profile

Feature #1580 ยป 0039-Add-ruleset-comments-for-tiledefs.patch

Marko Lindqvist, 11/22/2025 01:28 PM

View differences:

data/alien/terrain.ruleset
trade_bonus = 0
gui_type = "Other"
flags = "River", "UnrestrictedInfra"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/civ1/terrain.ruleset
compat_special = "River"
gui_type = "Other"
flags = "River", "UnrestrictedInfra"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/civ2/terrain.ruleset
compat_special = "River"
gui_type = "Other"
flags = "River", "UnrestrictedInfra"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/civ2civ3/terrain.ruleset
compat_special = "River"
flags = "River"
gui_type = "Other"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/classic/terrain.ruleset
compat_special = "River"
flags = "River", "UnrestrictedInfra"
gui_type = "Other"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/goldkeep/terrain.ruleset
compat_special = "River"
flags = "River", "UnrestrictedInfra"
gui_type = "Other"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/granularity/terrain.ruleset
compat_special = "None"
gui_type = "Other"
flags = "River", "UnrestrictedInfra"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/multiplayer/terrain.ruleset
compat_special = "River"
flags = "River", "UnrestrictedInfra"
gui_type = "Other"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/ruledit/comments-3.4.txt
; */ <-- avoid gettext warnings\n\
"
tiledefs = "\
\n\
; /* <-- avoid gettext warnings\n\
;\n\
; Tiledef types, there can be up to 8:\n\
;\n\
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,\n\
; and may be used in debug output when reading this file.\n\
;\n\
;\n\
; name = translatable name as seen by user\n\
; rule_name = (optional) internal name for savegames, rulesets\n\
; etc; if not present, \"name\" is used for this\n\
; purpose too. Since the name used in savegames must\n\
; not change, if you want to rename an item after\n\
; a ruleset has been released, you should set\n\
; \"rule_name\" to the original value of \"name\".\n\
; extras = List of extras that the tile must have\n\
; to satisfy tiledef requirements.\n\
;\n\
; */ <-- avoid gettext warnings\n\
"
extras = "\
\n\
; /* <-- avoid gettext warnings\n\
data/sandbox/terrain.ruleset
compat_special = "River"
gui_type = "Other"
flags = "River", "JumpFrom", "JumpTo"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/stub/terrain.ruleset
; compat_special = "None"
; gui_type = "Other"
; flags = ""
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
data/webperimental/terrain.ruleset
compat_special = "River"
gui_type = "Other"
flags = "River", "UnrestrictedInfra"
; /* <-- avoid gettext warnings
;
; Tiledef types, there can be up to 8:
;
; The actual tag used (the * in [tiledef_*]) must be unique for each tiledef,
; and may be used in debug output when reading this file.
;
;
; name = translatable name as seen by user
; rule_name = (optional) internal name for savegames, rulesets
; etc; if not present, "name" is used for this
; purpose too. Since the name used in savegames must
; not change, if you want to rename an item after a
; ruleset has been released, you should set
; "rule_name" to the original value of "name".
; extras = List of extras that the tile must have
; to satisfy tiledef requirements.
;
; */ <-- avoid gettext warnings
tools/ruleutil/comments.c
char *extras;
char *bases;
char *roads;
char *tiledefs;
char *styles;
char *citystyles;
char *musicstyles;
......
comment_load(comments_storage.extras, comment_file, "typedoc.extras");
comment_load(comments_storage.bases, comment_file, "typedoc.bases");
comment_load(comments_storage.roads, comment_file, "typedoc.roads");
comment_load(comments_storage.tiledefs, comment_file, "typedoc.tiledefs");
comment_load(comments_storage.styles, comment_file, "typedoc.styles");
comment_load(comments_storage.citystyles,
comment_file, "typedoc.citystyles");
......
comment_write(sfile, comments_storage.roads, "Roads");
}
/**********************************************************************//**
Write tiledefs header.
**************************************************************************/
void comment_tiledefs(struct section_file *sfile)
{
comment_write(sfile, comments_storage.tiledefs, "Tiledefs");
}
/**********************************************************************//**
Write styles header.
**************************************************************************/
tools/ruleutil/comments.h
void comment_extras(struct section_file *sfile);
void comment_bases(struct section_file *sfile);
void comment_roads(struct section_file *sfile);
void comment_tiledefs(struct section_file *sfile);
void comment_styles(struct section_file *sfile);
void comment_citystyles(struct section_file *sfile);
void comment_musicstyles(struct section_file *sfile);
tools/ruleutil/rulesave.c
}
} extra_type_by_cause_iterate_end;
// comment_tiledefs(sfile);
comment_tiledefs(sfile);
sect_idx = 0;
tiledef_iterate(td) {
    (1-1/1)