Changeset - r14612:34835c8eb396
[Not reviewed]
master
0 8 0
yexo - 15 years ago 2010-02-22 14:17:17
yexo@openttd.org
(svn r19199) -Codechange: add a 'name'-property to airport tiles
8 files changed with 39 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -2121,6 +2121,7 @@ STR_LAND_AREA_INFORMATION_LANDINFO_COORD
 
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_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}
 
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS                          :({COMMA}/8 {STRING})
src/misc_gui.cpp
Show inline comments
 
@@ -157,6 +157,7 @@ public:
 

	
 
		td.station_class = STR_NULL;
 
		td.station_name = STR_NULL;
 
		td.airport_tile_name = STR_NULL;
 

	
 
		td.grf = NULL;
 

	
 
@@ -243,6 +244,13 @@ public:
 
			line_nr++;
 
		}
 

	
 
		/* Station type 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]));
 
			line_nr++;
 
		}
 

	
 
		/* NewGRF name */
 
		if (td.grf != NULL) {
 
			SetDParamStr(0, td.grf);
src/newgrf.cpp
Show inline comments
 
@@ -3845,6 +3845,14 @@ static void FeatureNewName(ByteReader *b
 
						}
 
						break;
 

	
 
					case 0xC7: // Airporttile name
 
						if (_cur_grffile->airtspec == NULL || _cur_grffile->airtspec[GB(id, 0, 8)] == NULL) {
 
							grfmsg(1, "FeatureNewName: Attempt to name undefined airport tile 0x%X, ignoring", GB(id, 0, 8));
 
						} else {
 
							_cur_grffile->airtspec[GB(id, 0, 8)]->name = AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED);
 
						}
 
						break;
 

	
 
					case 0xC9: // House name
 
						if (_cur_grffile->housespec == NULL || _cur_grffile->housespec[GB(id, 0, 8)] == NULL) {
 
							grfmsg(1, "FeatureNewName: Attempt to name undefined house 0x%X, ignoring.", GB(id, 0, 8));
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -26,6 +26,7 @@
 
#include "variables.h"
 
#include "functions.h"
 
#include "core/random_func.hpp"
 
#include "table/strings.h"
 
#include "table/airporttiles.h"
 

	
 

	
src/newgrf_airporttiles.h
Show inline comments
 
@@ -33,6 +33,7 @@ struct AirportTileSpec {
 
	uint16 animation_info;                ///< Information about the animation (is it looping, how many loops etc)
 
	uint8 animation_speed;                ///< The speed of the animation
 

	
 
	StringID name;                        ///< Tile Subname string, land information on this tile will give you "AirportName (TileSubname)"
 
	uint8 callback_flags;                 ///< Flags telling which grf callback is set
 
	uint8 animation_triggers;             ///< When to start the animation
 
	uint8 animation_special_flags;        ///< Extra flags to influence the animation
src/station_cmd.cpp
Show inline comments
 
@@ -2643,6 +2643,16 @@ static void GetTileDesc_Station(TileInde
 
		}
 
	}
 

	
 
	if (IsAirport(tile)) {
 
		const AirportTileSpec *ats = AirportTileSpec::Get(GetAirportGfx(tile));
 
		td->airport_tile_name = ats->name;
 

	
 
		if (ats->grf_prop.grffile != NULL) {
 
			const GRFConfig *gc = GetGRFConfig(ats->grf_prop.grffile->grfid);
 
			td->grf = gc->name;
 
		}
 
	}
 

	
 
	StringID str;
 
	switch (GetStationType(tile)) {
 
		default: NOT_REACHED();
src/table/airporttiles.h
Show inline comments
 
@@ -13,7 +13,7 @@
 
#define AIRPORTTILES_H
 

	
 
/** Writes all airport tile properties in the AirportTile struct */
 
#define AT(num_frames, anim_speed) {(1 << 8) | num_frames, anim_speed, 0, 0, 0, true, {INVALID_AIRPORTTILE, 0, NULL, NULL, INVALID_AIRPORTTILE}}
 
#define AT(num_frames, anim_speed) {(1 << 8) | num_frames, anim_speed, STR_NULL, 0, 0, 0, true, {INVALID_AIRPORTTILE, 0, NULL, NULL, INVALID_AIRPORTTILE}}
 
/** Writes an airport tile without animation in the AirportTile struct */
 
#define AT_NOANIM {0xFFFF, 2}
 

	
src/tile_cmd.h
Show inline comments
 
@@ -51,14 +51,15 @@ struct TileInfo {
 

	
 
/** Tile description for the 'land area information' tool */
 
struct TileDesc {
 
	StringID str;           ///< Description of the tile
 
	Owner owner[4];         ///< Name of the owner(s)
 
	StringID owner_type[4]; ///< Type of each owner
 
	Date build_date;        ///< Date of construction of tile contents
 
	StringID station_class; ///< Class of station
 
	StringID station_name;  ///< Type of station within the class
 
	const char *grf;        ///< newGRF used for the tile contents
 
	uint64 dparam[2];       ///< Parameters of the \a str string
 
	StringID str;               ///< Description of the tile
 
	Owner owner[4];             ///< Name of the owner(s)
 
	StringID owner_type[4];     ///< Type of each owner
 
	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_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
 
};
 

	
 
/**
0 comments (0 inline, 0 general)