# HG changeset patch # User frosch # Date 2016-12-09 21:27:22 # Node ID b6106f114b301dc5e94dedd54f3fa04f900893ce # Parent 5d4d7408f8cd7131b67692497d7d5b7ead6be3a4 (svn r27686) -Change: List railtype of rail tiles explicitly in the tile info window. diff --git a/src/lang/english.txt b/src/lang/english.txt --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2589,6 +2589,7 @@ STR_LAND_AREA_INFORMATION_AIRPORTTILE_NA 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 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 --- 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 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2720,8 +2720,8 @@ static void GetTileDesc_Track(TileIndex { 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 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1684,6 +1684,7 @@ static void GetTileDesc_Road(TileIndex t 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 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2995,6 +2995,7 @@ static void GetTileDesc_Station(TileInde 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 --- 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 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -1612,6 +1612,7 @@ static void GetTileDesc_TunnelBridge(Til 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;