Difference between revisions of "NML:Badgetable"
(Add: Specs for badgetable, as separate site.) |
(For sake of compatibility and user experience) |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{NMLNavBlocksyntax}} |
{{NMLNavBlocksyntax}} |
||
| + | |||
| + | Since {{ottdp|15|no|ottdrev=8f14894}} |
||
Badgetable is a set of string entries separated by comma. It allows to use <code style="color:darkgreen">badges</code> property of common items. |
Badgetable is a set of string entries separated by comma. It allows to use <code style="color:darkgreen">badges</code> property of common items. |
||
| Line 8: | Line 10: | ||
Each <code style="color:darkgreen">ENTRY</code> consist of labels separated with slash. Last label is considered to identify the badge, others refer to classes that the badge belongs to. |
Each <code style="color:darkgreen">ENTRY</code> consist of labels separated with slash. Last label is considered to identify the badge, others refer to classes that the badge belongs to. |
||
| + | |||
| − | '''Note:''' Currently badges allow only for one level of nesting. |
||
| + | ''' For sake of compatibility and user experience, consider using [[NML:Badge labels|labels already introduced]] by other NewGRFs.''' |
||
| + | |||
| + | '''Note:''' Currently badge hierarchy in OpenTTD allows only for one level of nesting. <code style="color:darkgreen">colours/blue/skyblue</code> will end up as <code style="color:darkgreen">blue/skyblue</code> in <code style="color:darkgreen">colours</code> class instead of <code style="color:darkgreen">skyblue</code> in <code style="color:darkgreen">blue</code> class witch would be a subclass of <code style="color:darkgreen">colours</code>. |
||
<pre style="color:blue"> |
<pre style="color:blue"> |
||
Latest revision as of 15:49, 4 January 2026
Vehicles, Stations, Roadstops, Canals, Towns, Houses, Industries (Tiles), Cargos, Airports+Tiles, Objects, Railtypes, Roadtypes, Tramtypes, Bridges, Badges, Terrain
Badgetable is a set of string entries separated by comma. It allows to use badges property of common items.
badgetable {
"ENTRY" [, "ENTRY"]*
}
Each ENTRY consist of labels separated with slash. Last label is considered to identify the badge, others refer to classes that the badge belongs to.
For sake of compatibility and user experience, consider using labels already introduced by other NewGRFs.
Note: Currently badge hierarchy in OpenTTD allows only for one level of nesting. colours/blue/skyblue will end up as blue/skyblue in colours class instead of skyblue in blue class witch would be a subclass of colours.
badgetable {
"flag",
"flag/GB",
"flag/US",
"power",
"power/steam",
"power/diesel",
"power/electric",
}
A badge listed in a badgetable will automatically be created if it is not otherwise provided. However, it will not appear in the UI then (It still can be viewed in the NewGRF debug window).