summaryrefslogtreecommitdiff
path: root/src/newgrf_text.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-11-05 13:40:18 +0000
committerrubidium <rubidium@openttd.org>2010-11-05 13:40:18 +0000
commit399eedd884ae28d2a2e7c378fd81643a3b013495 (patch)
tree10fb527e524d9af6af7f6150fe7e6c31246d1296 /src/newgrf_text.cpp
parenta6f4769ec7f811fa9d1806028eeb413a7b2310ac (diff)
downloadopenttd-399eedd884ae28d2a2e7c378fd81643a3b013495.tar.xz
(svn r21086) -Feature-ish: [NewGRF] String code to print the weight in format based on settings
Diffstat (limited to 'src/newgrf_text.cpp')
-rw-r--r--src/newgrf_text.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index e0b713982..ae48aa3eb 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -309,6 +309,9 @@ char *TranslateTTDPatchCodes(uint32 grfid, const char *str)
case 0x0C:
d += Utf8Encode(d, SCC_NEWGRF_PRINT_WORD_STATION_NAME);
break;
+ case 0x0D:
+ d += Utf8Encode(d, SCC_NEWGRF_PRINT_WORD_WEIGHT);
+ break;
default:
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_WORD_SPEED:
case SCC_NEWGRF_PRINT_WORD_VOLUME:
+ case SCC_NEWGRF_PRINT_WORD_WEIGHT:
case SCC_NEWGRF_PRINT_WORD_STATION_NAME:
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:
return SCC_VOLUME;
+ case SCC_NEWGRF_PRINT_WORD_WEIGHT:
+ return SCC_WEIGHT;
+
case SCC_NEWGRF_PRINT_WORD_STATION_NAME:
return SCC_STATION_NAME;