OpenTTD Source
20241121-master-g67a0fccfad
|
Mapping of language data between a NewGRF and OpenTTD. More...
#include <newgrf_text_type.h>
Data Structures | |
struct | Mapping |
Mapping between NewGRF and OpenTTD IDs. More... | |
Public Member Functions | |
int | GetMapping (int newgrf_id, bool gender) const |
Get the mapping from the NewGRF supplied ID to OpenTTD's internal ID. More... | |
int | GetReverseMapping (int openttd_id, bool gender) const |
Get the mapping from OpenTTD's internal ID to the NewGRF supplied ID. More... | |
Static Public Member Functions | |
static const LanguageMap * | GetLanguageMap (uint32_t grfid, uint8_t language_id) |
Get the language map associated with a given NewGRF and language. More... | |
Data Fields | |
std::vector< Mapping > | gender_map |
Mapping of NewGRF and OpenTTD IDs for genders. | |
std::vector< Mapping > | case_map |
Mapping of NewGRF and OpenTTD IDs for cases. | |
int | plural_form |
The plural form used for this language. | |
Mapping of language data between a NewGRF and OpenTTD.
Definition at line 28 of file newgrf_text_type.h.
|
static |
Get the language map associated with a given NewGRF and language.
grfid | The NewGRF to get the map for. |
language_id | The (NewGRF) language ID to get the map for. |
Definition at line 2679 of file newgrf.cpp.
References GetFileByGRFID(), and GRFFile::language_map.
int LanguageMap::GetMapping | ( | int | newgrf_id, |
bool | gender | ||
) | const |
Get the mapping from the NewGRF supplied ID to OpenTTD's internal ID.
newgrf_id | The NewGRF ID to map. |
gender | Whether to map genders or cases. |
Definition at line 83 of file newgrf_text.cpp.
References case_map, and gender_map.
int LanguageMap::GetReverseMapping | ( | int | openttd_id, |
bool | gender | ||
) | const |
Get the mapping from OpenTTD's internal ID to the NewGRF supplied ID.
openttd_id | The OpenTTD ID to map. |
gender | Whether to map genders or cases. |
Definition at line 98 of file newgrf_text.cpp.
References case_map, and gender_map.