Loading
#openttdcoop - Paste
Archives
Trending
Docs
Login
ABAP
ActionScript
ActionScript 3
Ada
AIMMS3
ALGOL 68
Apache configuration
AppleScript
Apt sources
ARM ASSEMBLER
ASM
ASP
asymptote
Autoconf
Autohotkey
AutoIt
AviSynth
awk
BASCOM AVR
Bash
Basic4GL
BibTeX
BlitzBasic
bnf
Boo
Brainfuck
C
C#
C (LoadRunner)
C (Mac)
C (WinAPI)
C++
C++ (Qt)
C++ (WinAPI)
CAD DCL
CAD Lisp
CFDG
ChaiScript
Chapel
CIL
Clojure
CMake
COBOL
CoffeeScript
ColdFusion
CSS
Cuesheet
D
Dart
DCL
DCPU-16 Assembly
DCS
Delphi
Diff
DIV
DOS
dot
E
ECMAScript
Eiffel
eMail (mbox)
EPC
Erlang
Euphoria
EZT
F#
Falcon
FO (abas-ERP)
Formula One
Fortran
FreeBasic
FreeSWITCH
GADV 4CS
GAMBAS
GDB
genero
Genie
glSlang
GML
GNU/Octave
GNU Gettext
GNU make
Gnuplot
Go
Groovy
GwBasic
Haskell
Haxe
HicEst
HQ9+
HTML
HTML5
Icon
INI
Inno
INTERCAL
Io
ISPF Panel
J
Java
Java(TM) 2 Platform Standard Edition 5.0
Javascript
JCL
jQuery
KiXtart
KLone C
KLone C++
LaTeX
LDIF
Liberty BASIC
Lisp
LLVM Intermediate Representation
Locomotive Basic
Logtalk
LOLcode
Lotus Notes @Formulas
LotusScript
LScript
LSL2
Lua
MagikSF
MapBasic
Matlab M
Microchip Assembler
Microsoft Registry
mIRC Scripting
MMIX
Modula-2
Modula-3
MOS 6502 (6510) ACME Cross Assembler format
MOS 6502 (6510) Kick Assembler format
MOS 6502 (6510) TASM/64TASS 1.46 Assembler format
Motorola 68000 - HiSoft Devpac ST 2 Assembler format
Motorola 68000 Assembler
MXML
MySQL
Nagios
NetRexx
newlisp
nginx
Nimrod
NML NewGRF Meta Language
NSIS
Oberon-2
Objeck Programming Language
Objective-C
OCaml
OCaml (brief)
ooRexx
OpenBSD Packet Filter
OpenOffice.org Basic
Oracle 8 SQL
Oracle 11 SQL
Oxygene
OZ
ParaSail
PARI/GP
Pascal
PCRE
per
Perl
Perl 6
PHP
PHP (brief)
PIC16
Pike
Pixel Bender 1.0
PL/I
PL/SQL
PostgreSQL
PostScript
POVRAY
PowerBuilder
PowerShell
ProFTPd configuration
Progress
Prolog
PROPERTIES
ProvideX
Puppet
PureBasic
Python
Python for S60
q/kdb+
QBasic/QuickBASIC
QML
R / S+
Racket
Rails
RBScript
REBOL
rexx
robots.txt
RPM Specification File
Ruby
Rust
SAS
Scala
Scheme
SciLab
SCL
sdlBasic
Smalltalk
Smarty
SPARK
SPARQL
SQL
Squirrel Script
Squirrel Script with OpenTTD AI/GS
StandardML
StoneScript
SystemVerilog
T-SQL
TCL
Tera Term Macro
Text
thinBasic
TypoScript
Unicon (Unified Extended Dialect of Icon)
Uno Idl
Unreal Script
UPC
Urbi
Vala
vb.net
VBScript
Vedit macro language
Verilog
VHDL
Vim Script
Visual Basic
Visual Fox Pro
Visual Prolog
Whitespace
Whois (RPSL format)
Winbatch
X++
XBasic
XML
Xorg configuration
YAML
ZiLOG Z80 Assembler
ZXBasic
Index: src/newgrf_text.cpp =================================================================== --- src/newgrf_text.cpp (revision 27702) +++ src/newgrf_text.cpp (working copy) @@ -527,6 +527,7 @@ case 0x1B: case 0x1C: case 0x1D: + case 0x1E: d += Utf8Encode(d, SCC_NEWGRF_PRINT_DWORD_DATE_LONG + code - 0x16); break; @@ -996,6 +997,7 @@ case SCC_NEWGRF_PRINT_WORD_WEIGHT_SHORT: case SCC_NEWGRF_PRINT_WORD_POWER: case SCC_NEWGRF_PRINT_WORD_STATION_NAME: + case SCC_NEWGRF_PRINT_BYTE_CARGO_NAME: if (argv_size < 1) { DEBUG(misc, 0, "Too many NewGRF string parameters."); return 0; @@ -1059,6 +1061,10 @@ case SCC_NEWGRF_PRINT_WORD_STRING_ID: *argv = MapGRFStringID(_newgrf_textrefstack.grffile->grfid, _newgrf_textrefstack.PopUnsignedWord()); break; + + case SCC_NEWGRF_PRINT_BYTE_CARGO_NAME: + *argv = 1 << GetCargoTranslation(_newgrf_textrefstack.PopUnsignedByte(), _newgrf_textrefstack.grffile); + break; } } else { /* Consume additional parameter characters */ @@ -1128,6 +1134,9 @@ case SCC_NEWGRF_PRINT_WORD_CARGO_TINY: return SCC_CARGO_TINY; + case SCC_NEWGRF_PRINT_BYTE_CARGO_NAME: + return SCC_CARGO_LIST; + case SCC_NEWGRF_PRINT_WORD_STATION_NAME: return SCC_STATION_NAME; Index: src/table/control_codes.h =================================================================== --- src/table/control_codes.h (revision 27702) +++ src/table/control_codes.h (working copy) @@ -118,35 +118,36 @@ * It uses a "stack" of bytes and reads from there. */ SCC_NEWGRF_FIRST, - 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 - SCC_NEWGRF_PRINT_WORD_SPEED, ///< Read 2 bytes from the stack as signed speed - 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 - 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 - 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 - SCC_NEWGRF_PRINT_WORD_POWER, ///< Read 2 bytes from the stack as unsigned power - 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 - SCC_NEWGRF_PRINT_WORD_CARGO_LONG, ///< Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount - SCC_NEWGRF_PRINT_WORD_CARGO_SHORT, ///< Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount - SCC_NEWGRF_PRINT_WORD_CARGO_TINY, ///< Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount - 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) + SCC_NEWGRF_PRINT_DWORD_SIGNED = SCC_NEWGRF_FIRST, ///< 7B: Read 4 bytes from the stack + SCC_NEWGRF_PRINT_WORD_SIGNED, ///< 7C: Read 2 bytes from the stack as signed value + SCC_NEWGRF_PRINT_BYTE_SIGNED, ///< 7D: Read 1 byte from the stack as signed value + SCC_NEWGRF_PRINT_WORD_UNSIGNED, ///< 7E: Read 2 bytes from the stack as unsigned value + SCC_NEWGRF_PRINT_DWORD_CURRENCY, ///< 8F: Read 4 bytes from the stack as currency + SCC_NEWGRF_PRINT_WORD_STRING_ID, ///< 81: Read 2 bytes from the stack as String ID + SCC_NEWGRF_PRINT_WORD_DATE_LONG, ///< 82: Read 2 bytes from the stack as base 1920 date + SCC_NEWGRF_PRINT_WORD_DATE_SHORT, ///< 83: Read 2 bytes from the stack as base 1920 date + SCC_NEWGRF_PRINT_WORD_SPEED, ///< 84: Read 2 bytes from the stack as signed speed + SCC_NEWGRF_PRINT_WORD_VOLUME_LONG, ///< 87: Read 2 bytes from the stack as long signed volume + SCC_NEWGRF_PRINT_WORD_WEIGHT_LONG, ///< 9A 0D: Read 2 bytes from the stack as long unsigned weight + SCC_NEWGRF_PRINT_WORD_STATION_NAME, ///< 9A 0C: Read 2 bytes from the stack as station name + SCC_NEWGRF_PRINT_QWORD_CURRENCY, ///< 9A 01: Read 8 bytes from the stack as currency + SCC_NEWGRF_PRINT_BYTE_HEX, ///< 9A 06: Read 1 byte from the stack and print it as hex + SCC_NEWGRF_PRINT_WORD_HEX, ///< 9A 07: Read 2 bytes from the stack and print it as hex + SCC_NEWGRF_PRINT_DWORD_HEX, ///< 9A 08: Read 4 bytes from the stack and print it as hex + SCC_NEWGRF_PRINT_QWORD_HEX, ///< 9A 0B: Read 8 bytes from the stack and print it as hex + SCC_NEWGRF_PRINT_DWORD_DATE_LONG, ///< 9A 16: Read 4 bytes from the stack as base 0 date + SCC_NEWGRF_PRINT_DWORD_DATE_SHORT, ///< 9A 17: Read 4 bytes from the stack as base 0 date + SCC_NEWGRF_PRINT_WORD_POWER, ///< 9A 18: Read 2 bytes from the stack as unsigned power + SCC_NEWGRF_PRINT_WORD_VOLUME_SHORT, ///< 9A 19: Read 2 bytes from the stack as short signed volume + SCC_NEWGRF_PRINT_WORD_WEIGHT_SHORT, ///< 9A 1A: Read 2 bytes from the stack as short unsigned weight + SCC_NEWGRF_PRINT_WORD_CARGO_LONG, ///< 9A 1B: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount + SCC_NEWGRF_PRINT_WORD_CARGO_SHORT, ///< 9A 1C: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount + SCC_NEWGRF_PRINT_WORD_CARGO_TINY, ///< 9A 1D: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount + SCC_NEWGRF_PRINT_BYTE_CARGO_NAME, ///< 9A 1E: Read 1 byte from the stack as cargo name + SCC_NEWGRF_PUSH_WORD, ///< 9A 03: Pushes 2 bytes onto the stack + SCC_NEWGRF_UNPRINT, ///< 9A 04: "Unprints" the given number of bytes from the string + SCC_NEWGRF_DISCARD_WORD, ///< 85: Discard the next two bytes + SCC_NEWGRF_ROTATE_TOP_4_WORDS, ///< 86: Rotate the top 4 words of the stack (W4 W1 W2 W3) SCC_NEWGRF_LAST = SCC_NEWGRF_ROTATE_TOP_4_WORDS, SCC_NEWGRF_STRINL, ///< Inline another string at the current position, StringID is encoded in the string
Mark as private
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
forever