23 StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid,
bool new_scheme,
bool allow_newlines,
const char *text_to_add,
StringID def_string);
36 bool CheckGrfLangID(byte lang_id, byte grf_version);
40 void RewindTextRefStack();
44 uint
RemapNewGRFStringControlCode(uint scc,
char *buf_start,
char **buff,
const char **str, int64 *argv, uint argv_size,
bool modify_argv);
SmallVector< Mapping, 1 > case_map
Mapping of NewGRF and OpenTTD IDs for cases.
struct TextRefStack * CreateTextRefStackBackup()
Create a backup of the current NewGRF text stack.
Control codes that are embedded in the translation strings.
int plural_form
The plural form used for this language.
byte newgrf_id
NewGRF's internal ID for a case/gender.
Simple vector class that allows allocating an item without the need to copy this->data needlessly...
StringControlCode
List of string control codes used for string formatting, displaying, and by strgen to generate the la...
StringID GetGRFStringID(uint32 grfid, StringID stringid)
Returns the index for this stringid associated with its grfID.
const char * GetGRFStringPtr(uint16 stringid)
Get a C-string from a stringid set by a newgrf.
Simple vector template class.
bool UsingNewGRFTextStack()
Check whether the NewGRF text stack is in use.
static const LanguageMap * GetLanguageMap(uint32 grfid, uint8 language_id)
Get the language map associated with a given NewGRF and language.
void StartTextRefStackUsage(const GRFFile *grffile, byte numEntries, const uint32 *values=NULL)
Start using the TTDP compatible string code parsing.
Mapping between NewGRF and OpenTTD IDs.
void SetCurrentGrfLangID(byte language_id)
Equivalence Setter function between game and newgrf langID.
81: Read 2 bytes from the stack as String ID
void StopTextRefStackUsage()
Stop using the TTDP compatible string code parsing.
struct GRFText * DuplicateGRFText(struct GRFText *orig)
Create a copy of this GRFText list.
Mapping of language data between a NewGRF and OpenTTD.
byte langid
The language associated with this GRFText.
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.
byte openttd_id
OpenTTD's internal ID for a case/gender.
Element of the linked list.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
int GetReverseMapping(int openttd_id, bool gender) const
Get the mapping from OpenTTD's internal ID to the NewGRF supplied ID.
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.
char * TranslateTTDPatchCodes(uint32 grfid, uint8 language_id, bool allow_newlines, const char *str, int *olen=NULL, StringControlCode byte80=SCC_NEWGRF_PRINT_WORD_STRING_ID)
Translate TTDPatch string codes into something OpenTTD can handle (better).
const char * GetGRFStringFromGRFText(const GRFText *text)
Get a C-string from a GRFText-list.
static const WChar NFO_UTF8_IDENTIFIER
This character, the thorn ('รพ'), indicates a unicode string to NFO.
void AddGRFTextToList(struct GRFText **list, struct GRFText *text_to_add)
Add a GRFText to a GRFText list.
int GetMapping(int newgrf_id, bool gender) const
Get the mapping from the NewGRF supplied ID to OpenTTD's internal ID.
void RestoreTextRefStackBackup(struct TextRefStack *backup)
Restore a copy of the text stack to the used stack.
void CleanUpGRFText(struct GRFText *grftext)
Delete all items of a linked GRFText list.
Types related to strings.
void CleanUpStrings()
House cleaning.
SmallVector< Mapping, 1 > gender_map
Mapping of NewGRF and OpenTTD IDs for genders.
uint32 WChar
Type for wide characters, i.e.
Dynamic data of a loaded NewGRF.