|
OpenTTD Source
14.0-beta1
|
Go to the documentation of this file.
32 StringID AddGRFString(uint32_t grfid, uint16_t stringid,
byte langid,
bool new_scheme,
bool allow_newlines,
const char *text_to_add,
StringID def_string);
44 bool CheckGrfLangID(
byte lang_id,
byte grf_version);
70 int GetMapping(
int newgrf_id,
bool gender)
const;
StringID AddGRFString(uint32_t grfid, uint16_t stringid, byte langid, bool new_scheme, bool allow_newlines, const char *text_to_add, StringID def_string)
Add the new read string into our structure.
A GRF text with associated language ID.
std::vector< Mapping > case_map
Mapping of NewGRF and OpenTTD IDs for cases.
std::vector< GRFText > GRFTextList
A GRF text with a list of translations.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
std::string TranslateTTDPatchCodes(uint32_t grfid, uint8_t language_id, bool allow_newlines, const std::string &str, StringControlCode byte80=SCC_NEWGRF_PRINT_WORD_STRING_ID)
Translate TTDPatch string codes into something OpenTTD can handle (better).
int plural_form
The plural form used for this language.
void StartTextRefStackUsage(const GRFFile *grffile, byte numEntries, const uint32_t *values)
Start using the TTDP compatible string code parsing.
const char * GetGRFStringFromGRFText(const GRFTextList &text_list)
Get a C-string from a GRFText-list.
std::string text
The actual (translated) text.
StringID GetGRFStringID(uint32_t grfid, StringID stringid)
Returns the index for this stringid associated with its grfID.
@ SCC_NEWGRF_PRINT_WORD_STRING_ID
81: Read 2 bytes from the stack as String ID
byte openttd_id
OpenTTD's internal ID for a case/gender.
std::vector< Mapping > gender_map
Mapping of NewGRF and OpenTTD IDs for genders.
void CleanUpStrings()
House cleaning.
void AddGRFTextToList(GRFTextList &list, byte langid, uint32_t grfid, bool allow_newlines, const char *text_to_add)
Add a string to a GRFText list.
void RestoreTextRefStackBackup(struct TextRefStack *backup)
Restore a copy of the text stack to the used stack.
bool UsingNewGRFTextStack()
Check whether the NewGRF text stack is in use.
Mapping between NewGRF and OpenTTD IDs.
Mapping of language data between a NewGRF and OpenTTD.
void SetCurrentGrfLangID(byte language_id)
Equivalence Setter function between game and newgrf langID.
const char * GetGRFStringPtr(uint32_t stringid)
Get a C-string from a stringid set by a newgrf.
int GetMapping(int newgrf_id, bool gender) const
Get the mapping from the NewGRF supplied ID to OpenTTD's internal ID.
struct TextRefStack * CreateTextRefStackBackup()
Create a backup of the current NewGRF text stack.
StringControlCode
List of string control codes used for string formatting, displaying, and by strgen to generate the la...
void StopTextRefStackUsage()
Stop using the TTDP compatible string code parsing.
static const LanguageMap * GetLanguageMap(uint32_t grfid, uint8_t language_id)
Get the language map associated with a given NewGRF and language.
byte langid
The language associated with this GRFText.
static const char32_t NFO_UTF8_IDENTIFIER
This character, the thorn ('รพ'), indicates a unicode string to NFO.
int GetReverseMapping(int openttd_id, bool gender) const
Get the mapping from OpenTTD's internal ID to the NewGRF supplied ID.
std::shared_ptr< GRFTextList > GRFTextWrapper
Reference counted wrapper around a GRFText pointer.
byte newgrf_id
NewGRF's internal ID for a case/gender.
Dynamic data of a loaded NewGRF.