2007-12-21 19:49:27 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/** @file strings_type.h Types related to strings. */
|
|
|
|
|
|
|
|
#ifndef STRINGS_TYPE_H
|
|
|
|
#define STRINGS_TYPE_H
|
|
|
|
|
2008-08-01 09:34:34 +00:00
|
|
|
/**
|
|
|
|
* Numeric value that represents a string, independent of the selected language.
|
|
|
|
*/
|
2007-12-21 19:49:27 +00:00
|
|
|
typedef uint16 StringID;
|
2008-08-01 09:34:34 +00:00
|
|
|
static const StringID INVALID_STRING_ID = 0xFFFF; ///< Constant representing an invalid string
|
2007-12-21 19:49:27 +00:00
|
|
|
|
|
|
|
enum {
|
2008-08-01 09:34:34 +00:00
|
|
|
MAX_LANG = 64, ///< Maximal number of languages supported by the game
|
2007-12-21 19:49:27 +00:00
|
|
|
};
|
|
|
|
|
2008-10-17 17:42:51 +00:00
|
|
|
/** Directions a text can go to */
|
|
|
|
enum TextDirection {
|
|
|
|
TD_LTR, ///< Text is written left-to-right by default
|
|
|
|
TD_RTL, ///< Text is written right-to-left by default
|
|
|
|
};
|
|
|
|
|
2007-12-21 19:49:27 +00:00
|
|
|
/** Information about a language */
|
|
|
|
struct Language {
|
|
|
|
char *name; ///< The internal name of the language
|
|
|
|
char *file; ///< The name of the language as it appears on disk
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Used for dynamic language support */
|
|
|
|
struct DynamicLanguages {
|
2008-01-17 00:21:43 +00:00
|
|
|
int num; ///< Number of languages
|
|
|
|
int curr; ///< Currently selected language index
|
|
|
|
char curr_file[MAX_PATH]; ///< Currently selected language file name without path (needed for saving the filename of the loaded language).
|
2008-10-17 17:42:51 +00:00
|
|
|
TextDirection text_dir; ///< Text direction of the currently selected language
|
2008-01-17 00:21:43 +00:00
|
|
|
Language ent[MAX_LANG]; ///< Information about the languages
|
2007-12-21 19:49:27 +00:00
|
|
|
};
|
|
|
|
|
2008-08-01 09:34:34 +00:00
|
|
|
/** Special string constants */
|
2007-12-21 19:49:27 +00:00
|
|
|
enum SpecialStrings {
|
|
|
|
|
2009-03-15 00:32:18 +00:00
|
|
|
/* special strings for town names. the town name is generated dynamically on request. */
|
2007-12-21 19:49:27 +00:00
|
|
|
SPECSTR_TOWNNAME_START = 0x20C0,
|
|
|
|
SPECSTR_TOWNNAME_ENGLISH = SPECSTR_TOWNNAME_START,
|
|
|
|
SPECSTR_TOWNNAME_FRENCH,
|
|
|
|
SPECSTR_TOWNNAME_GERMAN,
|
|
|
|
SPECSTR_TOWNNAME_AMERICAN,
|
|
|
|
SPECSTR_TOWNNAME_LATIN,
|
|
|
|
SPECSTR_TOWNNAME_SILLY,
|
|
|
|
SPECSTR_TOWNNAME_SWEDISH,
|
|
|
|
SPECSTR_TOWNNAME_DUTCH,
|
|
|
|
SPECSTR_TOWNNAME_FINNISH,
|
|
|
|
SPECSTR_TOWNNAME_POLISH,
|
2009-04-19 14:11:17 +00:00
|
|
|
SPECSTR_TOWNNAME_SLOVAK,
|
2007-12-21 19:49:27 +00:00
|
|
|
SPECSTR_TOWNNAME_NORWEGIAN,
|
|
|
|
SPECSTR_TOWNNAME_HUNGARIAN,
|
|
|
|
SPECSTR_TOWNNAME_AUSTRIAN,
|
|
|
|
SPECSTR_TOWNNAME_ROMANIAN,
|
|
|
|
SPECSTR_TOWNNAME_CZECH,
|
|
|
|
SPECSTR_TOWNNAME_SWISS,
|
|
|
|
SPECSTR_TOWNNAME_DANISH,
|
|
|
|
SPECSTR_TOWNNAME_TURKISH,
|
|
|
|
SPECSTR_TOWNNAME_ITALIAN,
|
|
|
|
SPECSTR_TOWNNAME_CATALAN,
|
|
|
|
SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_CATALAN,
|
|
|
|
|
2009-03-15 00:32:18 +00:00
|
|
|
/* special strings for player names on the form "TownName transport". */
|
2007-12-21 19:49:27 +00:00
|
|
|
SPECSTR_PLAYERNAME_START = 0x70EA,
|
|
|
|
SPECSTR_PLAYERNAME_ENGLISH = SPECSTR_PLAYERNAME_START,
|
|
|
|
SPECSTR_PLAYERNAME_FRENCH,
|
|
|
|
SPECSTR_PLAYERNAME_GERMAN,
|
|
|
|
SPECSTR_PLAYERNAME_AMERICAN,
|
|
|
|
SPECSTR_PLAYERNAME_LATIN,
|
|
|
|
SPECSTR_PLAYERNAME_SILLY,
|
|
|
|
SPECSTR_PLAYERNAME_LAST = SPECSTR_PLAYERNAME_SILLY,
|
|
|
|
|
|
|
|
SPECSTR_ANDCO_NAME = 0x70E6,
|
|
|
|
SPECSTR_PRESIDENT_NAME = 0x70E7,
|
|
|
|
SPECSTR_SONGNAME = 0x70E8,
|
|
|
|
|
2009-03-15 00:32:18 +00:00
|
|
|
/* reserve MAX_LANG strings for the *.lng files */
|
2007-12-21 19:49:27 +00:00
|
|
|
SPECSTR_LANGUAGE_START = 0x7100,
|
|
|
|
SPECSTR_LANGUAGE_END = SPECSTR_LANGUAGE_START + MAX_LANG - 1,
|
|
|
|
|
2009-03-15 00:32:18 +00:00
|
|
|
/* reserve 32 strings for various screen resolutions */
|
2007-12-21 19:49:27 +00:00
|
|
|
SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1,
|
|
|
|
SPECSTR_RESOLUTION_END = SPECSTR_RESOLUTION_START + 0x1F,
|
|
|
|
|
2009-03-15 00:32:18 +00:00
|
|
|
/* reserve 32 strings for screenshot formats */
|
2007-12-21 19:49:27 +00:00
|
|
|
SPECSTR_SCREENSHOT_START = SPECSTR_RESOLUTION_END + 1,
|
|
|
|
SPECSTR_SCREENSHOT_END = SPECSTR_SCREENSHOT_START + 0x1F,
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* STRINGS_TYPE_H */
|