diff options
author | michi_cc <michi_cc@openttd.org> | 2011-11-07 19:35:02 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-11-07 19:35:02 +0000 |
commit | fe574b7e0cf3d1a4c3d748b7bda521aa7b10ed7c (patch) | |
tree | cc15cdf7bb17bd1636a7dca14742fa93e490abcb /src/newgrf.cpp | |
parent | 58b75963dd9c91d5616d519c84f0c1ac3f519041 (diff) | |
download | openttd-fe574b7e0cf3d1a4c3d748b7bda521aa7b10ed7c.tar.xz |
(svn r23129) -Add: [NewGRF] Property for the rail type name.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 508eb15ba..530eb5a9b 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3770,9 +3770,10 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, ByteR buf->ReadDWord(); break; - case 0x09: // Name of railtype - rti->strings.toolbar_caption = buf->ReadWord(); + case 0x09: // Toolbar caption of railtype (sets name as well for backwards compatibility) + rti->strings.name = rti->strings.toolbar_caption = buf->ReadWord(); _string_to_grf_mapping[&rti->strings.toolbar_caption] = _cur.grffile->grfid; + _string_to_grf_mapping[&rti->strings.name] = _cur.grffile->grfid; break; case 0x0A: // Menu text of railtype @@ -3855,6 +3856,11 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, ByteR rti->sorting_order = buf->ReadByte(); break; + case 0x1B: // Name of railtype (overridden by prop 09) + rti->strings.name = buf->ReadWord(); + _string_to_grf_mapping[&rti->strings.name] = _cur.grffile->grfid; + break; + default: ret = CIR_UNKNOWN; break; @@ -3890,13 +3896,14 @@ static ChangeInfoResult RailTypeReserveInfo(uint id, int numinfo, int prop, Byte break; } - case 0x09: // Name of railtype + case 0x09: // Toolbar caption of railtype case 0x0A: // Menu text case 0x0B: // Build window caption case 0x0C: // Autoreplace text case 0x0D: // New loco case 0x13: // Construction cost case 0x14: // Speed limit + case 0x1B: // Name of railtype buf->ReadWord(); break; |