OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
35 StringID AddGRFString(uint32 grfid, uint16 stringid,
byte langid,
bool new_scheme,
bool allow_newlines,
const char *text_to_add,
StringID def_string);
47 bool CheckGrfLangID(
byte lang_id,
byte grf_version);
51 void RewindTextRefStack();
55 uint
RemapNewGRFStringControlCode(uint scc,
char *buf_start,
char **buff,
const char **str, int64 *argv, uint argv_size,
bool modify_argv);
75 int GetMapping(
int newgrf_id,
bool gender)
const;
A GRF text with associated language ID.
std::vector< Mapping > case_map
Mapping of NewGRF and OpenTTD IDs for cases.
char32_t WChar
Type for wide characters, i.e.
std::vector< GRFText > GRFTextList
A GRF text with a list of translations.
int plural_form
The plural form used for this language.
StringID AddGRFString(uint32 grfid, uint16 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.
const char * GetGRFStringFromGRFText(const GRFTextList &text_list)
Get a C-string from a GRFText-list.
void StartTextRefStackUsage(const GRFFile *grffile, byte numEntries, const uint32 *values)
Start using the TTDP compatible string code parsing.
std::string text
The actual (translated) text.
static const WChar NFO_UTF8_IDENTIFIER
This character, the thorn ('รพ'), indicates a unicode string to NFO.
@ SCC_NEWGRF_PRINT_WORD_STRING_ID
81: Read 2 bytes from the stack as String ID
static const LanguageMap * GetLanguageMap(uint32 grfid, uint8 language_id)
Get the language map associated with a given NewGRF and language.
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 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.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Mapping of language data between a NewGRF and OpenTTD.
void SetCurrentGrfLangID(byte language_id)
Equivalence Setter function between game and newgrf langID.
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.
void AddGRFTextToList(GRFTextList &list, byte langid, uint32 grfid, bool allow_newlines, const char *text_to_add)
Add a string to a GRFText list.
byte langid
The language associated with this GRFText.
std::string TranslateTTDPatchCodes(uint32 grfid, uint8 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).
StringID GetGRFStringID(uint32 grfid, StringID stringid)
Returns the index for this stringid associated with its grfID.
int GetReverseMapping(int openttd_id, bool gender) const
Get the mapping from OpenTTD's internal ID to the NewGRF supplied ID.
const char * GetGRFStringPtr(uint16 stringid)
Get a C-string from a stringid set by a newgrf.
std::shared_ptr< GRFTextList > GRFTextWrapper
Reference counted wrapper around a GRFText pointer.
uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const char **str, int64 *argv, uint argv_size, bool modify_argv)
FormatString for NewGRF specific "magic" string control codes.
byte newgrf_id
NewGRF's internal ID for a case/gender.
Dynamic data of a loaded NewGRF.