Difference between revisions of "NML:Badges"
From GRFSpecs
Jump to navigationJump to search (Add missing parts.) |
m (Docs for flags) |
||
| Line 26: | Line 26: | ||
| |
| |
||
; COPY_TO_RELATED_ENTITY |
; COPY_TO_RELATED_ENTITY |
||
| + | : Badge can be copied to related entity (e.g. badge on a railtype can be copied to rail vehicles of that railtype.) |
||
; NAME_LIST_STOP |
; NAME_LIST_STOP |
||
| + | : Stops adding more names to the visible name list. |
||
; NAME_LIST_FIRST_ONLY |
; NAME_LIST_FIRST_ONLY |
||
| + | : Add this name to the visible name list only if this is the first name. |
||
; USE_COMPANY_COLOUR |
; USE_COMPANY_COLOUR |
||
: Recolour badge depending on company that player currently controls. |
: Recolour badge depending on company that player currently controls. |
||
; NAME_SKIP |
; NAME_SKIP |
||
| + | : Allow the badge to be excluded from the badge name list. |
||
|} |
|} |
||
Revision as of 11:35, 4 January 2026
Vehicles, Stations, Roadstops, Canals, Towns, Houses, Industries (Tiles), Cargos, Airports+Tiles, Objects, Railtypes, Roadtypes, Tramtypes, Bridges, Badges, Terrain
- common props | vars | CBs
- train | roadveh | ship | aircr props
- common variables
- industry props | vars | CBs
- tile props | vars | CBs
- airport props | vars | CBs
- tile props | vars | CBs
item (FEAT_BADGES, item_name) { ... }
Badge properties
| property | value range | comment |
|---|---|---|
| label | string with / as delimiter
|
Badges with label without / are considered to be classes.
Labels for other badges should match following syntax:
|
| name | string | Name of this badge or badge class. |
| flags | bitmask(BADGE_FLAG_XXX, ...); |
|
Badge variables
| name | value range | comment |
|---|---|---|
| intro_date | IDK |
Badge callbacks
| callback | return value | comment |
|---|---|---|
| default | spriteset | Graphics for the badge or badge class. |
|
aircraft |
spriteset | Override default graphics when used by other specific feature. |
Example code
item (FEAT_BADGES, power) {
property {
label: "power";
name: string(STR_POWER);
}
}
item (FEAT_BADGES, diesel) {
property {
label: "power/diesel";
name: string(STR_POWER_DIESEL);
}
}
item (FEAT_BADGES, steam) {
property {
label: "power/steam";
name: string(STR_POWER_STEAM);
}
graphics {
default: sprite_steam;
}
}