OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

strings_type.h
Go to the documentation of this file.
1 /* $Id: strings_type.h 27758 2017-02-26 19:41:30Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef STRINGS_TYPE_H
13 #define STRINGS_TYPE_H
14
18 typedef uint32 StringID;
19 static const StringID INVALID_STRING_ID = 0xFFFF;
20 static const int MAX_CHAR_LENGTH = 4;
21 static const uint MAX_LANG = 0x7F;
22
24 enum TextDirection {
25 TD_LTR,
26 TD_RTL,
27 };
28
30 enum StringTab {
31 /* Tabs 0..1 for regular strings */
32 TEXT_TAB_TOWN = 4,
33 TEXT_TAB_INDUSTRY = 9,
34 TEXT_TAB_STATION = 12,
35 TEXT_TAB_SPECIAL = 14,
36 TEXT_TAB_OLD_CUSTOM = 15,
37 TEXT_TAB_VEHICLE = 16,
38 /* Tab 17 for regular strings */
39 TEXT_TAB_OLD_NEWGRF = 26,
40 TEXT_TAB_END = 32,
41 TEXT_TAB_GAMESCRIPT_START = 32,
42 TEXT_TAB_NEWGRF_START = 64,
43 };
44
46 static const uint TAB_SIZE_BITS = 11;
48 static const uint TAB_SIZE = 1 << TAB_SIZE_BITS;
49
51 static const uint TAB_SIZE_GAMESCRIPT = TAB_SIZE * 32;
52
54 static const uint TAB_SIZE_NEWGRF = TAB_SIZE * 256;
55
57 enum SpecialStrings {
58
59 /* special strings for town names. the town name is generated dynamically on request. */
60 SPECSTR_TOWNNAME_START = 0x20C0,
61 SPECSTR_TOWNNAME_ENGLISH = SPECSTR_TOWNNAME_START,
62 SPECSTR_TOWNNAME_FRENCH,
63 SPECSTR_TOWNNAME_GERMAN,
64 SPECSTR_TOWNNAME_AMERICAN,
65 SPECSTR_TOWNNAME_LATIN,
66 SPECSTR_TOWNNAME_SILLY,
67 SPECSTR_TOWNNAME_SWEDISH,
68 SPECSTR_TOWNNAME_DUTCH,
69 SPECSTR_TOWNNAME_FINNISH,
70 SPECSTR_TOWNNAME_POLISH,
71 SPECSTR_TOWNNAME_SLOVAK,
72 SPECSTR_TOWNNAME_NORWEGIAN,
73 SPECSTR_TOWNNAME_HUNGARIAN,
74 SPECSTR_TOWNNAME_AUSTRIAN,
75 SPECSTR_TOWNNAME_ROMANIAN,
76 SPECSTR_TOWNNAME_CZECH,
77 SPECSTR_TOWNNAME_SWISS,
78 SPECSTR_TOWNNAME_DANISH,
79 SPECSTR_TOWNNAME_TURKISH,
80 SPECSTR_TOWNNAME_ITALIAN,
81 SPECSTR_TOWNNAME_CATALAN,
82 SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_CATALAN,
83
84 /* special strings for company names on the form "TownName transport". */
85 SPECSTR_COMPANY_NAME_START = 0x70EA,
86 SPECSTR_COMPANY_NAME_LAST = SPECSTR_COMPANY_NAME_START + SPECSTR_TOWNNAME_LAST - SPECSTR_TOWNNAME_START,
87
88 SPECSTR_SILLY_NAME = 0x70E5,
89 SPECSTR_ANDCO_NAME = 0x70E6,
90 SPECSTR_PRESIDENT_NAME = 0x70E7,
91
92 /* reserve MAX_LANG strings for the *.lng files */
93 SPECSTR_LANGUAGE_START = 0x7100,
94 SPECSTR_LANGUAGE_END = SPECSTR_LANGUAGE_START + MAX_LANG - 1,
95
96 /* reserve 32 strings for various screen resolutions */
97 SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1,
98 SPECSTR_RESOLUTION_END = SPECSTR_RESOLUTION_START + 0x1F,
99 };
100
101 #endif /* STRINGS_TYPE_H */