#include "strings_type.h"
Go to the source code of this file.
Data Structures | |
struct | StringIDCompare |
Key comparison function for std::map. More... | |
Functions | |
char * | InlineString (char *buf, StringID string) |
char * | GetString (char *buffr, StringID string, const char *last) |
const char * | GetStringPtr (StringID string) |
void | InjectDParam (int amount) |
static void | SetDParamX (uint64 *s, uint n, uint64 v) |
static void | SetDParam (uint n, uint64 v) |
void | SetDParamStr (uint n, const char *str) |
This function is used to "bind" a C string to a OpenTTD dparam slot. | |
StringID | BindCString (const char *str) |
This function takes a C-string and allocates a temporary string ID. | |
static uint64 | GetDParamX (const uint64 *s, uint n) |
static uint64 | GetDParam (uint n) |
static void | CopyInDParam (int offs, const uint64 *src, int num) |
static void | CopyOutDParam (uint64 *dst, int offs, int num) |
bool | ReadLanguagePack (int index) |
void | InitializeLanguagePacks () |
Make a list of the available language packs. | |
int CDECL | StringIDSorter (const void *a, const void *b) |
void | CheckForMissingGlyphsInLoadedLanguagePack () |
Check whether the currently loaded language pack uses characters that the currently loaded font does not support. | |
Variables | |
char | _userstring [128] |
DynamicLanguages | _dynlang |
Definition in file strings_func.h.
StringID BindCString | ( | const char * | str | ) |
This function takes a C-string and allocates a temporary string ID.
The duration of the bound string is valid only until the next call to GetString, so be careful.
The StringID of the bound string is valid until BindCString is called another NUM_BOUND_STRINGS times. So be careful when using it.
str | temp string to add |
Definition at line 212 of file strings.cpp.
Referenced by CheckForMissingGlyphsInLoadedLanguagePack(), and SetDParamStr().
void CheckForMissingGlyphsInLoadedLanguagePack | ( | ) |
Check whether the currently loaded language pack uses characters that the currently loaded font does not support.
If this is the case an error message will be shown in English. The error message will not be localized because that would mean it might use characters that are not in the font, which is the whole reason this check has been added.
Definition at line 1494 of file strings.cpp.
References BindCString().
void InitializeLanguagePacks | ( | ) |
Make a list of the available language packs.
put the data in _dynlang struct.
< Matching the language in the configuartion file or the current locale
< Using pt_PT for pt_BR locale when pt_BR is not available
< Fallback when no locale-matching language has been found
Definition at line 1426 of file strings.cpp.
References DynamicLanguages::curr_file, DynamicLanguages::ent, error, Language::file, FOR_ALL_SEARCHPATHS, GetCurrentLocale(), GetLanguageFileHeader(), GetLanguageList(), LANG_DIR, Language::name, and DynamicLanguages::num.
void SetDParamStr | ( | uint | n, | |
const char * | str | |||
) |
This function is used to "bind" a C string to a OpenTTD dparam slot.
n | slot of the string | |
str | string to bind |
Definition at line 223 of file strings.cpp.
References BindCString().
Referenced by GetSaveLoadErrorString(), RailVehicleLengthChanged(), SaveFileError(), and StartScenario().