mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r20716) -Feature: add airport class and airport name to the land info tool
This commit is contained in:
parent
e640373475
commit
c07fdab16c
|
@ -2164,6 +2164,8 @@ STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordina
|
|||
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Built: {LTBLUE}{DATE_LONG}
|
||||
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Station class: {LTBLUE}{STRING}
|
||||
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Station type: {LTBLUE}{STRING}
|
||||
STR_LAND_AREA_INFORMATION_AIRPORT_CLASS :{BLACK}Airport class: {LTBLUE}{STRING}
|
||||
STR_LAND_AREA_INFORMATION_AIRPORT_NAME :{BLACK}Airport name: {LTBLUE}{STRING}
|
||||
STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}Airport tile name: {LTBLUE}{STRING}
|
||||
STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{RAW_STRING}
|
||||
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}
|
||||
|
|
|
@ -149,6 +149,8 @@ public:
|
|||
|
||||
td.station_class = STR_NULL;
|
||||
td.station_name = STR_NULL;
|
||||
td.airport_class = STR_NULL;
|
||||
td.airport_name = STR_NULL;
|
||||
td.airport_tile_name = STR_NULL;
|
||||
td.rail_speed = 0;
|
||||
|
||||
|
@ -237,7 +239,21 @@ public:
|
|||
line_nr++;
|
||||
}
|
||||
|
||||
/* Station type name */
|
||||
/* Airport class */
|
||||
if (td.airport_class != STR_NULL) {
|
||||
SetDParam(0, td.airport_class);
|
||||
GetString(this->landinfo_data[line_nr], STR_LAND_AREA_INFORMATION_AIRPORT_CLASS, lastof(this->landinfo_data[line_nr]));
|
||||
line_nr++;
|
||||
}
|
||||
|
||||
/* Airport name */
|
||||
if (td.airport_name != STR_NULL) {
|
||||
SetDParam(0, td.airport_name);
|
||||
GetString(this->landinfo_data[line_nr], STR_LAND_AREA_INFORMATION_AIRPORT_NAME, lastof(this->landinfo_data[line_nr]));
|
||||
line_nr++;
|
||||
}
|
||||
|
||||
/* Airport tile name */
|
||||
if (td.airport_tile_name != STR_NULL) {
|
||||
SetDParam(0, td.airport_tile_name);
|
||||
GetString(this->landinfo_data[line_nr], STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME, lastof(this->landinfo_data[line_nr]));
|
||||
|
|
|
@ -207,7 +207,7 @@ static void NewAirportResolver(ResolverObject *res, TileIndex tile, Station *st,
|
|||
res->count = 0;
|
||||
|
||||
const AirportSpec *as = AirportSpec::Get(airport_id);
|
||||
res->grffile = (as != NULL ? as->grf_prop.grffile : NULL);
|
||||
res->grffile = as->grf_prop.grffile;
|
||||
}
|
||||
|
||||
SpriteID GetCustomAirportSprite(const AirportSpec *as, byte layout)
|
||||
|
|
|
@ -2805,10 +2805,17 @@ static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
|
|||
}
|
||||
|
||||
if (IsAirport(tile)) {
|
||||
const AirportSpec *as = Station::GetByTile(tile)->airport.GetSpec();
|
||||
td->airport_class = AirportClass::GetName(as->cls_id);
|
||||
td->airport_name = as->name;
|
||||
|
||||
const AirportTileSpec *ats = AirportTileSpec::GetByTile(tile);
|
||||
td->airport_tile_name = ats->name;
|
||||
|
||||
if (ats->grf_prop.grffile != NULL) {
|
||||
if (as->grf_prop.grffile != NULL) {
|
||||
const GRFConfig *gc = GetGRFConfig(as->grf_prop.grffile->grfid);
|
||||
td->grf = gc->GetName();
|
||||
} else if (ats->grf_prop.grffile != NULL) {
|
||||
const GRFConfig *gc = GetGRFConfig(ats->grf_prop.grffile->grfid);
|
||||
td->grf = gc->GetName();
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ struct TileDesc {
|
|||
Date build_date; ///< Date of construction of tile contents
|
||||
StringID station_class; ///< Class of station
|
||||
StringID station_name; ///< Type of station within the class
|
||||
StringID airport_class; ///< Name of the airport class
|
||||
StringID airport_name; ///< Name of the airport
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue