summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-12-09 21:27:22 +0000
committerfrosch <frosch@openttd.org>2016-12-09 21:27:22 +0000
commit10293c5fb1b90dcf13847fd07e44534550f1d656 (patch)
treeef12482ee662c30cd3ce90528a2d647378654d70 /src
parentacc817b3f5fc1f41044332ba81d5c5f5825fe2e7 (diff)
downloadopenttd-10293c5fb1b90dcf13847fd07e44534550f1d656.tar.xz
(svn r27686) -Change: List railtype of rail tiles explicitly in the tile info window.
Diffstat (limited to 'src')
-rw-r--r--src/lang/english.txt47
-rw-r--r--src/misc_gui.cpp8
-rw-r--r--src/rail_cmd.cpp2
-rw-r--r--src/road_cmd.cpp1
-rw-r--r--src/station_cmd.cpp1
-rw-r--r--src/tile_cmd.h1
-rw-r--r--src/tunnelbridge_cmd.cpp1
7 files changed, 37 insertions, 24 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 508bfbb22..0b8406e24 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -2589,6 +2589,7 @@ STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}Airport
STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{RAW_STRING}
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
+STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}Rail type: {LTBLUE}{STRING}
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Rail speed limit: {LTBLUE}{VELOCITY}
STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Road speed limit: {LTBLUE}{VELOCITY}
@@ -2601,29 +2602,29 @@ STR_LAI_CLEAR_DESCRIPTION_FIELDS :Fields
STR_LAI_CLEAR_DESCRIPTION_SNOW_COVERED_LAND :Snow-covered land
STR_LAI_CLEAR_DESCRIPTION_DESERT :Desert
-STR_LAI_RAIL_DESCRIPTION_TRACK :{STRING} track
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_SIGNALS :{STRING} track with block signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRESIGNALS :{STRING} track with pre-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXITSIGNALS :{STRING} track with exit-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBOSIGNALS :{STRING} track with combo-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBSSIGNALS :{STRING} track with path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NOENTRYSIGNALS :{STRING} track with one-way path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PRESIGNALS :{STRING} track with block and pre-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_EXITSIGNALS :{STRING} track with block and exit-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_COMBOSIGNALS :{STRING} track with block and combo-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PBSSIGNALS :{STRING} track with block and path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_NOENTRYSIGNALS :{STRING} track with block and one-way path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_EXITSIGNALS :{STRING} track with pre- and exit-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_COMBOSIGNALS :{STRING} track with pre- and combo-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_PBSSIGNALS :{STRING} track with pre- and path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_NOENTRYSIGNALS :{STRING} track with pre- and one-way path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_COMBOSIGNALS :{STRING} track with exit- and combo-signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_PBSSIGNALS :{STRING} track with exit- and path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_NOENTRYSIGNALS :{STRING} track with exit- and one-way path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_PBSSIGNALS :{STRING} track with combo- and path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_NOENTRYSIGNALS :{STRING} track with combo- and one-way path signals
-STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBS_NOENTRYSIGNALS :{STRING} track with path and one-way path signals
-STR_LAI_RAIL_DESCRIPTION_TRAIN_DEPOT :{STRING} train depot
+STR_LAI_RAIL_DESCRIPTION_TRACK :Railway track
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_SIGNALS :Railway track with block signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRESIGNALS :Railway track with pre-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXITSIGNALS :Railway track with exit-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBOSIGNALS :Railway track with combo-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBSSIGNALS :Railway track with path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NOENTRYSIGNALS :Railway track with one-way path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PRESIGNALS :Railway track with block and pre-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_EXITSIGNALS :Railway track with block and exit-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_COMBOSIGNALS :Railway track with block and combo-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PBSSIGNALS :Railway track with block and path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_NOENTRYSIGNALS :Railway track with block and one-way path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_EXITSIGNALS :Railway track with pre- and exit-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_COMBOSIGNALS :Railway track with pre- and combo-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_PBSSIGNALS :Railway track with pre- and path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_NOENTRYSIGNALS :Railway track with pre- and one-way path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_COMBOSIGNALS :Railway track with exit- and combo-signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_PBSSIGNALS :Railway track with exit- and path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_NOENTRYSIGNALS :Railway track with exit- and one-way path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_PBSSIGNALS :Railway track with combo- and path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_NOENTRYSIGNALS :Railway track with combo- and one-way path signals
+STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBS_NOENTRYSIGNALS :Railway track with path and one-way path signals
+STR_LAI_RAIL_DESCRIPTION_TRAIN_DEPOT :Railway train depot
STR_LAI_ROAD_DESCRIPTION_ROAD :Road
STR_LAI_ROAD_DESCRIPTION_ROAD_WITH_STREETLIGHTS :Road with street lights
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index b751407e2..2d3871ffb 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -162,6 +162,7 @@ public:
td.airport_class = STR_NULL;
td.airport_name = STR_NULL;
td.airport_tile_name = STR_NULL;
+ td.railtype = STR_NULL;
td.rail_speed = 0;
td.road_speed = 0;
@@ -272,6 +273,13 @@ public:
line_nr++;
}
+ /* Rail type name */
+ if (td.railtype != STR_NULL) {
+ SetDParam(0, td.railtype);
+ GetString(this->landinfo_data[line_nr], STR_LANG_AREA_INFORMATION_RAIL_TYPE, lastof(this->landinfo_data[line_nr]));
+ line_nr++;
+ }
+
/* Rail speed limit */
if (td.rail_speed != 0) {
SetDParam(0, td.rail_speed);
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index eda02481c..d6c9194de 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -2720,8 +2720,8 @@ static void GetTileDesc_Track(TileIndex tile, TileDesc *td)
{
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
td->rail_speed = rti->max_speed;
+ td->railtype = rti->strings.name;
td->owner[0] = GetTileOwner(tile);
- SetDParamX(td->dparam, 0, rti->strings.name);
switch (GetRailTileType(tile)) {
case RAIL_TILE_NORMAL:
td->str = STR_LAI_RAIL_DESCRIPTION_TRACK;
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index ddd8bd0e9..6482a14b1 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -1684,6 +1684,7 @@ static void GetTileDesc_Road(TileIndex tile, TileDesc *td)
if (HasBit(rts, ROADTYPE_TRAM)) tram_owner = GetRoadOwner(tile, ROADTYPE_TRAM);
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
+ td->railtype = rti->strings.name;
td->rail_speed = rti->max_speed;
break;
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 65be42d85..610cf7216 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2995,6 +2995,7 @@ static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
td->rail_speed = rti->max_speed;
+ td->railtype = rti->strings.name;
}
if (IsAirport(tile)) {
diff --git a/src/tile_cmd.h b/src/tile_cmd.h
index 966694bfb..6b8d6c69f 100644
--- a/src/tile_cmd.h
+++ b/src/tile_cmd.h
@@ -62,6 +62,7 @@ struct TileDesc {
StringID airport_tile_name; ///< Name of the airport tile
const char *grf; ///< newGRF used for the tile contents
uint64 dparam[2]; ///< Parameters of the \a str string
+ StringID railtype; ///< Type of rail on the tile.
uint16 rail_speed; ///< Speed limit of rail (bridges and track)
uint16 road_speed; ///< Speed limit of road (bridges)
};
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 677cf9975..9ba9b26e3 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1612,6 +1612,7 @@ static void GetTileDesc_TunnelBridge(TileIndex tile, TileDesc *td)
if (tt == TRANSPORT_RAIL) {
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
td->rail_speed = rti->max_speed;
+ td->railtype = rti->strings.name;
if (!IsTunnel(tile)) {
uint16 spd = GetBridgeSpec(GetBridgeType(tile))->speed;