2006-11-16 22:05:33 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file control_codes.h Control codes that are embedded in the translation strings. */
|
|
|
|
|
2006-11-16 22:05:33 +00:00
|
|
|
#ifndef CONTROL_CODES_H
|
|
|
|
#define CONTROL_CODES_H
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/**
|
|
|
|
* List of string control codes used for string formatting, displaying, and
|
|
|
|
* by strgen to generate the language files.
|
|
|
|
*/
|
2007-09-22 23:55:34 +00:00
|
|
|
enum StringControlCode {
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_CONTROL_START = 0xE000,
|
|
|
|
SCC_CONTROL_END = 0xE1FF,
|
|
|
|
|
|
|
|
SCC_SPRITE_START = 0xE200,
|
|
|
|
SCC_SPRITE_END = SCC_SPRITE_START + 0xFF,
|
|
|
|
|
|
|
|
/* Display control codes */
|
|
|
|
SCC_SETX = SCC_CONTROL_START,
|
|
|
|
SCC_SETXY,
|
2008-08-01 09:34:34 +00:00
|
|
|
SCC_TINYFONT, ///< Switch to small font
|
|
|
|
SCC_BIGFONT, ///< Switch to large font
|
2006-11-16 22:05:33 +00:00
|
|
|
|
|
|
|
/* Formatting control codes */
|
|
|
|
SCC_REVISION,
|
2009-07-20 11:21:57 +00:00
|
|
|
SCC_COMPANY_NUM,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_STATION_FEATURES,
|
|
|
|
SCC_INDUSTRY_NAME,
|
|
|
|
SCC_WAYPOINT_NAME,
|
|
|
|
SCC_STATION_NAME,
|
2010-05-12 18:19:36 +00:00
|
|
|
SCC_DEPOT_NAME,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_TOWN_NAME,
|
2007-05-19 09:40:18 +00:00
|
|
|
SCC_GROUP_NAME,
|
2007-06-24 22:42:11 +00:00
|
|
|
SCC_VEHICLE_NAME,
|
2007-06-25 10:40:56 +00:00
|
|
|
SCC_SIGN_NAME,
|
2007-06-25 13:30:38 +00:00
|
|
|
SCC_COMPANY_NAME,
|
2008-09-30 21:18:28 +00:00
|
|
|
SCC_PRESIDENT_NAME,
|
2007-06-25 14:46:32 +00:00
|
|
|
SCC_ENGINE_NAME,
|
2006-11-16 22:05:33 +00:00
|
|
|
|
2011-11-19 22:15:44 +00:00
|
|
|
SCC_CURRENCY_SHORT,
|
|
|
|
SCC_CURRENCY_LONG,
|
2006-11-16 22:05:33 +00:00
|
|
|
|
2011-11-19 22:15:44 +00:00
|
|
|
SCC_CARGO_LONG,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_CARGO_SHORT,
|
2011-11-23 16:04:28 +00:00
|
|
|
SCC_CARGO_TINY,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_POWER,
|
2011-11-19 22:15:44 +00:00
|
|
|
SCC_VOLUME_LONG,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_VOLUME_SHORT,
|
2011-11-19 22:15:44 +00:00
|
|
|
SCC_WEIGHT_LONG,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_WEIGHT_SHORT,
|
|
|
|
SCC_FORCE,
|
|
|
|
SCC_VELOCITY,
|
2010-05-04 22:04:28 +00:00
|
|
|
SCC_HEIGHT,
|
2006-11-16 22:05:33 +00:00
|
|
|
|
|
|
|
SCC_DATE_TINY,
|
|
|
|
SCC_DATE_SHORT,
|
|
|
|
SCC_DATE_LONG,
|
2009-01-03 00:56:16 +00:00
|
|
|
SCC_DATE_ISO,
|
2006-11-16 22:05:33 +00:00
|
|
|
|
|
|
|
SCC_STRING1,
|
|
|
|
SCC_STRING2,
|
|
|
|
SCC_STRING3,
|
|
|
|
SCC_STRING4,
|
|
|
|
SCC_STRING5,
|
|
|
|
|
2011-12-19 21:05:57 +00:00
|
|
|
SCC_ENCODED,
|
|
|
|
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_STRING,
|
|
|
|
SCC_COMMA,
|
2011-04-09 20:26:14 +00:00
|
|
|
SCC_DECIMAL,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_NUM,
|
2009-11-19 13:53:54 +00:00
|
|
|
SCC_ZEROFILL_NUM,
|
2008-09-14 14:31:37 +00:00
|
|
|
SCC_HEX,
|
2009-01-16 12:59:47 +00:00
|
|
|
SCC_BYTES,
|
2006-11-16 22:05:33 +00:00
|
|
|
|
|
|
|
SCC_STRING_ID,
|
2008-07-17 13:47:04 +00:00
|
|
|
SCC_RAW_STRING_POINTER,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_PLURAL_LIST,
|
|
|
|
SCC_GENDER_LIST,
|
|
|
|
SCC_GENDER_INDEX,
|
|
|
|
SCC_ARG_INDEX,
|
2011-11-19 22:15:44 +00:00
|
|
|
SCC_SET_CASE,
|
2006-11-16 22:05:33 +00:00
|
|
|
SCC_SWITCH_CASE,
|
|
|
|
|
|
|
|
/* Colour codes */
|
|
|
|
SCC_BLUE,
|
|
|
|
SCC_SILVER,
|
|
|
|
SCC_GOLD,
|
|
|
|
SCC_RED,
|
|
|
|
SCC_PURPLE,
|
|
|
|
SCC_LTBROWN,
|
|
|
|
SCC_ORANGE,
|
|
|
|
SCC_GREEN,
|
|
|
|
SCC_YELLOW,
|
|
|
|
SCC_DKGREEN,
|
|
|
|
SCC_CREAM,
|
|
|
|
SCC_BROWN,
|
|
|
|
SCC_WHITE,
|
|
|
|
SCC_LTBLUE,
|
|
|
|
SCC_GRAY,
|
|
|
|
SCC_DKBLUE,
|
|
|
|
SCC_BLACK,
|
2007-08-07 15:20:31 +00:00
|
|
|
SCC_PREVIOUS_COLOUR,
|
2006-11-16 22:05:33 +00:00
|
|
|
|
2007-09-22 23:55:34 +00:00
|
|
|
/**
|
|
|
|
* The next variables are part of a NewGRF subsystem for creating text strings.
|
|
|
|
* It uses a "stack" of bytes and reads from there.
|
|
|
|
*/
|
|
|
|
SCC_NEWGRF_FIRST,
|
2011-08-20 22:06:38 +00:00
|
|
|
SCC_NEWGRF_PRINT_DWORD_SIGNED = SCC_NEWGRF_FIRST, ///< Read 4 bytes from the stack
|
|
|
|
SCC_NEWGRF_PRINT_WORD_SIGNED, ///< Read 2 bytes from the stack as signed value
|
|
|
|
SCC_NEWGRF_PRINT_BYTE_SIGNED, ///< Read 1 byte from the stack as signed value
|
|
|
|
SCC_NEWGRF_PRINT_WORD_UNSIGNED, ///< Read 2 bytes from the stack as unsigned value
|
|
|
|
SCC_NEWGRF_PRINT_DWORD_CURRENCY, ///< Read 4 bytes from the stack as currency
|
|
|
|
SCC_NEWGRF_PRINT_WORD_STRING_ID, ///< Read 2 bytes from the stack as String ID
|
|
|
|
SCC_NEWGRF_PRINT_WORD_DATE_LONG, ///< Read 2 bytes from the stack as base 1920 date
|
|
|
|
SCC_NEWGRF_PRINT_WORD_DATE_SHORT, ///< Read 2 bytes from the stack as base 1920 date
|
2011-08-20 23:16:49 +00:00
|
|
|
SCC_NEWGRF_PRINT_WORD_SPEED, ///< Read 2 bytes from the stack as signed speed
|
2011-10-29 20:56:58 +00:00
|
|
|
SCC_NEWGRF_PRINT_WORD_VOLUME_LONG, ///< Read 2 bytes from the stack as long signed volume
|
|
|
|
SCC_NEWGRF_PRINT_WORD_WEIGHT_LONG, ///< Read 2 bytes from the stack as long unsigned weight
|
2011-08-20 22:06:38 +00:00
|
|
|
SCC_NEWGRF_PRINT_WORD_STATION_NAME, ///< Read 2 bytes from the stack as station name
|
|
|
|
SCC_NEWGRF_PRINT_QWORD_CURRENCY, ///< Read 8 bytes from the stack as currency
|
|
|
|
SCC_NEWGRF_PRINT_BYTE_HEX, ///< Read 1 byte from the stack and print it as hex
|
|
|
|
SCC_NEWGRF_PRINT_WORD_HEX, ///< Read 2 bytes from the stack and print it as hex
|
|
|
|
SCC_NEWGRF_PRINT_DWORD_HEX, ///< Read 4 bytes from the stack and print it as hex
|
|
|
|
SCC_NEWGRF_PRINT_QWORD_HEX, ///< Read 8 bytes from the stack and print it as hex
|
2011-08-20 22:35:11 +00:00
|
|
|
SCC_NEWGRF_PRINT_DWORD_DATE_LONG, ///< Read 4 bytes from the stack as base 0 date
|
|
|
|
SCC_NEWGRF_PRINT_DWORD_DATE_SHORT, ///< Read 4 bytes from the stack as base 0 date
|
2011-08-20 23:07:37 +00:00
|
|
|
SCC_NEWGRF_PRINT_WORD_POWER, ///< Read 2 bytes from the stack as unsigned power
|
2011-10-29 20:56:58 +00:00
|
|
|
SCC_NEWGRF_PRINT_WORD_VOLUME_SHORT, ///< Read 2 bytes from the stack as short signed volume
|
|
|
|
SCC_NEWGRF_PRINT_WORD_WEIGHT_SHORT, ///< Read 2 bytes from the stack as short unsigned weight
|
2011-08-20 22:06:38 +00:00
|
|
|
SCC_NEWGRF_PUSH_WORD, ///< Pushes 2 bytes onto the stack
|
|
|
|
SCC_NEWGRF_UNPRINT, ///< "Unprints" the given number of bytes from the string
|
|
|
|
SCC_NEWGRF_DISCARD_WORD, ///< Discard the next two bytes
|
|
|
|
SCC_NEWGRF_ROTATE_TOP_4_WORDS, ///< Rotate the top 4 words of the stack (W4 W1 W2 W3)
|
2007-09-22 23:55:34 +00:00
|
|
|
SCC_NEWGRF_LAST = SCC_NEWGRF_ROTATE_TOP_4_WORDS,
|
|
|
|
|
2011-08-20 22:06:38 +00:00
|
|
|
SCC_NEWGRF_STRINL, ///< Inline another string at the current position, StringID is encoded in the string
|
2011-01-21 23:10:02 +00:00
|
|
|
|
2006-11-16 22:05:33 +00:00
|
|
|
/* Special printable symbols.
|
|
|
|
* These are mapped to the original glyphs */
|
2011-11-19 22:15:44 +00:00
|
|
|
SCC_LESS_THAN = SCC_SPRITE_START + 0x3C,
|
|
|
|
SCC_GREATER_THAN = SCC_SPRITE_START + 0x3E,
|
|
|
|
SCC_UP_ARROW = SCC_SPRITE_START + 0xA0,
|
|
|
|
SCC_DOWN_ARROW = SCC_SPRITE_START + 0xAA,
|
|
|
|
SCC_CHECKMARK = SCC_SPRITE_START + 0xAC,
|
|
|
|
SCC_CROSS = SCC_SPRITE_START + 0xAD,
|
|
|
|
SCC_RIGHT_ARROW = SCC_SPRITE_START + 0xAF,
|
|
|
|
SCC_TRAIN = SCC_SPRITE_START + 0xB4,
|
|
|
|
SCC_LORRY = SCC_SPRITE_START + 0xB5,
|
|
|
|
SCC_BUS = SCC_SPRITE_START + 0xB6,
|
|
|
|
SCC_PLANE = SCC_SPRITE_START + 0xB7,
|
|
|
|
SCC_SHIP = SCC_SPRITE_START + 0xB8,
|
|
|
|
SCC_SUPERSCRIPT_M1 = SCC_SPRITE_START + 0xB9,
|
|
|
|
SCC_SMALL_UP_ARROW = SCC_SPRITE_START + 0xBC,
|
|
|
|
SCC_SMALL_DOWN_ARROW = SCC_SPRITE_START + 0xBD,
|
2006-11-16 22:05:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* CONTROL_CODES_H */
|