mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r21086) -Feature-ish: [NewGRF] String code to print the weight in format based on settings
This commit is contained in:
parent
16a2f22741
commit
77c1838b3d
@ -309,6 +309,9 @@ char *TranslateTTDPatchCodes(uint32 grfid, const char *str)
|
|||||||
case 0x0C:
|
case 0x0C:
|
||||||
d += Utf8Encode(d, SCC_NEWGRF_PRINT_WORD_STATION_NAME);
|
d += Utf8Encode(d, SCC_NEWGRF_PRINT_WORD_STATION_NAME);
|
||||||
break;
|
break;
|
||||||
|
case 0x0D:
|
||||||
|
d += Utf8Encode(d, SCC_NEWGRF_PRINT_WORD_WEIGHT);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
grfmsg(1, "missing handler for extended format code");
|
grfmsg(1, "missing handler for extended format code");
|
||||||
@ -720,6 +723,7 @@ uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const
|
|||||||
case SCC_NEWGRF_PRINT_HEX_WORD:
|
case SCC_NEWGRF_PRINT_HEX_WORD:
|
||||||
case SCC_NEWGRF_PRINT_WORD_SPEED:
|
case SCC_NEWGRF_PRINT_WORD_SPEED:
|
||||||
case SCC_NEWGRF_PRINT_WORD_VOLUME:
|
case SCC_NEWGRF_PRINT_WORD_VOLUME:
|
||||||
|
case SCC_NEWGRF_PRINT_WORD_WEIGHT:
|
||||||
case SCC_NEWGRF_PRINT_WORD_STATION_NAME:
|
case SCC_NEWGRF_PRINT_WORD_STATION_NAME:
|
||||||
case SCC_NEWGRF_PRINT_UNSIGNED_WORD: *argv = _newgrf_textrefstack->PopUnsignedWord(); break;
|
case SCC_NEWGRF_PRINT_UNSIGNED_WORD: *argv = _newgrf_textrefstack->PopUnsignedWord(); break;
|
||||||
|
|
||||||
@ -771,6 +775,9 @@ uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const
|
|||||||
case SCC_NEWGRF_PRINT_WORD_VOLUME:
|
case SCC_NEWGRF_PRINT_WORD_VOLUME:
|
||||||
return SCC_VOLUME;
|
return SCC_VOLUME;
|
||||||
|
|
||||||
|
case SCC_NEWGRF_PRINT_WORD_WEIGHT:
|
||||||
|
return SCC_WEIGHT;
|
||||||
|
|
||||||
case SCC_NEWGRF_PRINT_WORD_STATION_NAME:
|
case SCC_NEWGRF_PRINT_WORD_STATION_NAME:
|
||||||
return SCC_STATION_NAME;
|
return SCC_STATION_NAME;
|
||||||
|
|
||||||
|
@ -121,6 +121,7 @@ enum StringControlCode {
|
|||||||
SCC_NEWGRF_PRINT_MONTH_YEAR, ///< Read 2 bytes from the stack as base 1920 date
|
SCC_NEWGRF_PRINT_MONTH_YEAR, ///< 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_SPEED, ///< Read 2 bytes from the stack as signed speed
|
||||||
SCC_NEWGRF_PRINT_WORD_VOLUME, ///< Read 2 bytes from the stack as signed volume
|
SCC_NEWGRF_PRINT_WORD_VOLUME, ///< Read 2 bytes from the stack as signed volume
|
||||||
|
SCC_NEWGRF_PRINT_WORD_WEIGHT, ///< Read 2 bytes from the stack as signed weight
|
||||||
SCC_NEWGRF_PRINT_WORD_STATION_NAME, ///< Read 2 bytes from the stack as station name
|
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_QWORD_CURRENCY, ///< Read 8 bytes from the stack as currency
|
||||||
SCC_NEWGRF_PRINT_HEX_BYTE, ///< Read 1 byte from the stack and print it as hex
|
SCC_NEWGRF_PRINT_HEX_BYTE, ///< Read 1 byte from the stack and print it as hex
|
||||||
|
Loading…
Reference in New Issue
Block a user