Codechange: Update minimum CMake version to 3.16 for all parts. (#13141)
[openttd-github.git] / src / table / control_codes.h
blobd2022c3cec5ee76e6c3012f10cdc7988b874e7d2
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
8 /** @file control_codes.h Control codes that are embedded in the translation strings. */
10 #ifndef CONTROL_CODES_H
11 #define CONTROL_CODES_H
13 /**
14 * List of string control codes used for string formatting, displaying, and
15 * by strgen to generate the language files.
17 enum StringControlCode {
18 SCC_CONTROL_START = 0xE000,
19 SCC_CONTROL_END = 0xE1FF,
21 SCC_SPRITE_START = 0xE200,
22 SCC_SPRITE_END = SCC_SPRITE_START + 0xFF,
24 /* This must be the first entry. It's encoded in strings that are saved. */
25 SCC_ENCODED = SCC_CONTROL_START,
27 /* Font selection codes, must be in same order as FontSize enum */
28 SCC_FIRST_FONT,
29 SCC_NORMALFONT = SCC_FIRST_FONT, ///< Switch to normal size font
30 SCC_TINYFONT, ///< Switch to small font
31 SCC_BIGFONT, ///< Switch to large font
32 SCC_MONOFONT, ///< Switch to monospaced font
33 SCC_LAST_FONT = SCC_MONOFONT,
35 /* Formatting control codes */
36 SCC_REVISION,
37 SCC_COMPANY_NUM,
38 SCC_STATION_FEATURES,
39 SCC_INDUSTRY_NAME,
40 SCC_WAYPOINT_NAME,
41 SCC_STATION_NAME,
42 SCC_DEPOT_NAME,
43 SCC_TOWN_NAME,
44 SCC_GROUP_NAME,
45 SCC_VEHICLE_NAME,
46 SCC_SIGN_NAME,
47 SCC_COMPANY_NAME,
48 SCC_PRESIDENT_NAME,
49 SCC_ENGINE_NAME,
51 SCC_CURRENCY_SHORT,
52 SCC_CURRENCY_LONG,
54 SCC_CARGO_LONG,
55 SCC_CARGO_SHORT,
56 SCC_CARGO_TINY,
57 SCC_CARGO_LIST,
58 SCC_POWER,
59 SCC_POWER_TO_WEIGHT,
60 SCC_VOLUME_LONG,
61 SCC_VOLUME_SHORT,
62 SCC_WEIGHT_LONG,
63 SCC_WEIGHT_SHORT,
64 SCC_FORCE,
65 SCC_VELOCITY,
66 SCC_HEIGHT,
68 SCC_UNITS_DAYS_OR_SECONDS,
69 SCC_UNITS_MONTHS_OR_MINUTES,
70 SCC_UNITS_YEARS_OR_PERIODS,
71 SCC_UNITS_YEARS_OR_MINUTES,
73 SCC_DATE_TINY,
74 SCC_DATE_SHORT,
75 SCC_DATE_LONG,
76 SCC_DATE_ISO,
78 /* Must be consecutive */
79 SCC_STRING1,
80 SCC_STRING2,
81 SCC_STRING3,
82 SCC_STRING4,
83 SCC_STRING5,
84 SCC_STRING6,
85 SCC_STRING7,
88 SCC_STRING,
89 SCC_COMMA,
90 SCC_DECIMAL,
91 SCC_NUM,
92 SCC_ZEROFILL_NUM,
93 SCC_HEX,
94 SCC_BYTES,
96 SCC_RAW_STRING_POINTER,
97 SCC_PLURAL_LIST,
98 SCC_GENDER_LIST,
99 SCC_GENDER_INDEX,
100 SCC_ARG_INDEX,
101 SCC_SET_CASE,
102 SCC_SWITCH_CASE,
104 /* Colour codes */
105 SCC_BLUE,
106 SCC_SILVER,
107 SCC_GOLD,
108 SCC_RED,
109 SCC_PURPLE,
110 SCC_LTBROWN,
111 SCC_ORANGE,
112 SCC_GREEN,
113 SCC_YELLOW,
114 SCC_DKGREEN,
115 SCC_CREAM,
116 SCC_BROWN,
117 SCC_WHITE,
118 SCC_LTBLUE,
119 SCC_GRAY,
120 SCC_DKBLUE,
121 SCC_BLACK,
122 SCC_COLOUR,
123 SCC_PUSH_COLOUR,
124 SCC_POP_COLOUR,
127 * The next variables are part of a NewGRF subsystem for creating text strings.
128 * It uses a "stack" of bytes and reads from there.
130 SCC_NEWGRF_FIRST,
131 SCC_NEWGRF_PRINT_DWORD_SIGNED = SCC_NEWGRF_FIRST, ///< 7B: Read 4 bytes from the stack
132 SCC_NEWGRF_PRINT_WORD_SIGNED, ///< 7C: Read 2 bytes from the stack as signed value
133 SCC_NEWGRF_PRINT_BYTE_SIGNED, ///< 7D: Read 1 byte from the stack as signed value
134 SCC_NEWGRF_PRINT_WORD_UNSIGNED, ///< 7E: Read 2 bytes from the stack as unsigned value
135 SCC_NEWGRF_PRINT_DWORD_CURRENCY, ///< 8F: Read 4 bytes from the stack as currency
136 SCC_NEWGRF_PRINT_WORD_STRING_ID, ///< 81: Read 2 bytes from the stack as String ID
137 SCC_NEWGRF_PRINT_WORD_DATE_LONG, ///< 82: Read 2 bytes from the stack as base 1920 date
138 SCC_NEWGRF_PRINT_WORD_DATE_SHORT, ///< 83: Read 2 bytes from the stack as base 1920 date
139 SCC_NEWGRF_PRINT_WORD_SPEED, ///< 84: Read 2 bytes from the stack as signed speed
140 SCC_NEWGRF_PRINT_WORD_VOLUME_LONG, ///< 87: Read 2 bytes from the stack as long signed volume
141 SCC_NEWGRF_PRINT_WORD_WEIGHT_LONG, ///< 9A 0D: Read 2 bytes from the stack as long unsigned weight
142 SCC_NEWGRF_PRINT_WORD_STATION_NAME, ///< 9A 0C: Read 2 bytes from the stack as station name
143 SCC_NEWGRF_PRINT_QWORD_CURRENCY, ///< 9A 01: Read 8 bytes from the stack as currency
144 SCC_NEWGRF_PRINT_BYTE_HEX, ///< 9A 06: Read 1 byte from the stack and print it as hex
145 SCC_NEWGRF_PRINT_WORD_HEX, ///< 9A 07: Read 2 bytes from the stack and print it as hex
146 SCC_NEWGRF_PRINT_DWORD_HEX, ///< 9A 08: Read 4 bytes from the stack and print it as hex
147 SCC_NEWGRF_PRINT_QWORD_HEX, ///< 9A 0B: Read 8 bytes from the stack and print it as hex
148 SCC_NEWGRF_PRINT_DWORD_DATE_LONG, ///< 9A 16: Read 4 bytes from the stack as base 0 date
149 SCC_NEWGRF_PRINT_DWORD_DATE_SHORT, ///< 9A 17: Read 4 bytes from the stack as base 0 date
150 SCC_NEWGRF_PRINT_WORD_POWER, ///< 9A 18: Read 2 bytes from the stack as unsigned power
151 SCC_NEWGRF_PRINT_WORD_VOLUME_SHORT, ///< 9A 19: Read 2 bytes from the stack as short signed volume
152 SCC_NEWGRF_PRINT_WORD_WEIGHT_SHORT, ///< 9A 1A: Read 2 bytes from the stack as short unsigned weight
153 SCC_NEWGRF_PRINT_WORD_CARGO_LONG, ///< 9A 1B: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount
154 SCC_NEWGRF_PRINT_WORD_CARGO_SHORT, ///< 9A 1C: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount
155 SCC_NEWGRF_PRINT_WORD_CARGO_TINY, ///< 9A 1D: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount
156 SCC_NEWGRF_PRINT_WORD_CARGO_NAME, ///< 9A 1E: Read 2 bytes from the stack as cargo name
157 SCC_NEWGRF_PRINT_DWORD_FORCE, ///< 9A 21: Read 4 bytes from the stack as unsigned force
158 SCC_NEWGRF_PUSH_WORD, ///< 9A 03: Pushes 2 bytes onto the stack
159 SCC_NEWGRF_DISCARD_WORD, ///< 85: Discard the next two bytes
160 SCC_NEWGRF_ROTATE_TOP_4_WORDS, ///< 86: Rotate the top 4 words of the stack (W4 W1 W2 W3)
161 SCC_NEWGRF_LAST = SCC_NEWGRF_ROTATE_TOP_4_WORDS,
163 SCC_NEWGRF_STRINL, ///< Inline another string at the current position, StringID is encoded in the string
165 /* Special printable symbols.
166 * These are mapped to the original glyphs */
167 SCC_LESS_THAN = SCC_SPRITE_START + 0x3C,
168 SCC_GREATER_THAN = SCC_SPRITE_START + 0x3E,
169 SCC_UP_ARROW = SCC_SPRITE_START + 0xA0,
170 SCC_DOWN_ARROW = SCC_SPRITE_START + 0xAA,
171 SCC_CHECKMARK = SCC_SPRITE_START + 0xAC,
172 SCC_CROSS = SCC_SPRITE_START + 0xAD,
173 SCC_RIGHT_ARROW = SCC_SPRITE_START + 0xAF,
174 SCC_TRAIN = SCC_SPRITE_START + 0xB4,
175 SCC_LORRY = SCC_SPRITE_START + 0xB5,
176 SCC_BUS = SCC_SPRITE_START + 0xB6,
177 SCC_PLANE = SCC_SPRITE_START + 0xB7,
178 SCC_SHIP = SCC_SPRITE_START + 0xB8,
179 SCC_SUPERSCRIPT_M1 = SCC_SPRITE_START + 0xB9,
180 SCC_SMALL_UP_ARROW = SCC_SPRITE_START + 0xBC,
181 SCC_SMALL_DOWN_ARROW = SCC_SPRITE_START + 0xBD,
184 #endif /* CONTROL_CODES_H */