Changeset - r9714:24e754d1822b
[Not reviewed]
master
0 8 0
smatz - 16 years ago 2008-07-25 22:37:34
smatz@openttd.org
(svn r13830) -Feature: show additional NewGRF info in the Tile Info window for stations, houses and industries
8 files changed with 65 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -389,13 +389,18 @@ static void GetAcceptedCargo_Industry(Ti
 
static void GetTileDesc_Industry(TileIndex tile, TileDesc *td)
 
{
 
	const Industry *i = GetIndustryByTile(tile);
 
	const IndustrySpec *is = GetIndustrySpec(i->type);
 

	
 
	td->owner[0] = i->owner;
 
	td->str = GetIndustrySpec(i->type)->name;
 
	td->str = is->name;
 
	if (!IsIndustryCompleted(tile)) {
 
		SetDParamX(td->dparam, 0, td->str);
 
		td->str = STR_2058_UNDER_CONSTRUCTION;
 
	}
 

	
 
	if (is->grf_prop.grffile != NULL) {
 
		td->grf = GetGRFConfig(is->grf_prop.grffile->grfid)->name;
 
	}
 
}
 

	
 
static CommandCost ClearTile_Industry(TileIndex tile, byte flags)
src/lang/english.txt
Show inline comments
 
@@ -3126,6 +3126,10 @@ STR_BRIBE_FAILED                        
 
STR_BRIBE_FAILED_2                                              :{WHITE}discovered by a regional investigator
 
STR_BUILD_DATE                                                  :{BLACK}Built: {LTBLUE}{DATE_LONG}
 

	
 
STR_TILEDESC_STATION_CLASS                                      :{BLACK}Station class: {LTBLUE}{STRING}
 
STR_TILEDESC_STATION_TYPE                                       :{BLACK}Station type: {LTBLUE}{STRING}
 
STR_TILEDESC_NEWGRF_NAME                                        :{BLACK}NewGRF: {LTBLUE}{RAW_STRING}
 

	
 
STR_PERFORMANCE_DETAIL                                          :{WHITE}Detailed performance rating
 
STR_PERFORMANCE_DETAIL_KEY                                      :{BLACK}Detail
 
STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY                          :{BLACK}({CURRCOMPACT}/{CURRCOMPACT})
src/misc_gui.cpp
Show inline comments
 
@@ -73,7 +73,7 @@ static const WindowDesc _land_info_desc 
 

	
 
class LandInfoWindow : public Window {
 
	enum {
 
		LAND_INFO_CENTERED_LINES   = 9,                        ///< Up to 9 centered lines
 
		LAND_INFO_CENTERED_LINES   = 12,                       ///< Up to 12 centered lines
 
		LAND_INFO_MULTICENTER_LINE = LAND_INFO_CENTERED_LINES, ///< One multicenter line
 
		LAND_INFO_LINE_END,
 

	
 
@@ -131,6 +131,11 @@ public:
 
		td.owner[2] = OWNER_NONE;
 
		td.owner[3] = OWNER_NONE;
 

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

	
 
		td.grf = NULL;
 

	
 
		GetAcceptedCargo(tile, ac);
 
		GetTileDesc(tile, &td);
 

	
 
@@ -186,6 +191,29 @@ public:
 
			line_nr++;
 
		}
 

	
 
		/* Station class */
 
		if (td.station_class != STR_NULL) {
 
			SetDParam(0, td.station_class);
 
			GetString(this->landinfo_data[line_nr], STR_TILEDESC_STATION_CLASS, lastof(this->landinfo_data[line_nr]));
 
			line_nr++;
 
		}
 

	
 
		/* Station type name */
 
		if (td.station_name != STR_NULL) {
 
			SetDParam(0, td.station_name);
 
			GetString(this->landinfo_data[line_nr], STR_TILEDESC_STATION_TYPE, lastof(this->landinfo_data[line_nr]));
 
			line_nr++;
 
		}
 

	
 
		/* NewGRF name */
 
		if (td.grf != NULL) {
 
			SetDParamStr(0, td.grf);
 
			GetString(this->landinfo_data[line_nr], STR_TILEDESC_NEWGRF_NAME, lastof(this->landinfo_data[line_nr]));
 
			line_nr++;
 
		}
 

	
 
		assert(line_nr < LAND_INFO_CENTERED_LINES);
 

	
 
		/* Mark last line empty */
 
		this->landinfo_data[line_nr][0] = '\0';
 

	
src/newgrf_station.cpp
Show inline comments
 
@@ -835,7 +835,7 @@ bool DrawStationTile(int x, int y, RailT
 
}
 

	
 

	
 
static const StationSpec* GetStationSpec(TileIndex t)
 
const StationSpec *GetStationSpec(TileIndex t)
 
{
 
	const Station* st;
 
	uint specindex;
src/newgrf_station.h
Show inline comments
 
@@ -110,6 +110,7 @@ void ResetStationClasses();
 
StationClassID AllocateStationClass(uint32 cls);
 
void SetStationClassName(StationClassID sclass, StringID name);
 
StringID GetStationClassName(StationClassID sclass);
 
const StationSpec *GetStationSpec(TileIndex t);
 

	
 
uint GetNumStationClasses();
 
uint GetNumCustomStations(StationClassID sclass);
src/station_cmd.cpp
Show inline comments
 
@@ -43,6 +43,7 @@
 
#include "oldpool_func.h"
 
#include "animated_tile_func.h"
 
#include "elrail_func.h"
 
#include "newgrf.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
@@ -2312,6 +2313,18 @@ static void GetTileDesc_Station(TileInde
 
	}
 
	td->build_date = GetStationByTile(tile)->build_date;
 

	
 
	const StationSpec *spec = GetStationSpec(tile);
 

	
 
	if (spec != NULL) {
 
		td->station_class = GetStationClassName(spec->sclass);
 
		td->station_name = spec->name;
 

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

	
 
	StringID str;
 
	switch (GetStationType(tile)) {
 
		default: NOT_REACHED();
src/tile_cmd.h
Show inline comments
 
@@ -52,6 +52,9 @@ struct TileDesc {
 
	Owner owner[4];
 
	StringID owner_type[4];
 
	Date build_date;
 
	StringID station_class;
 
	StringID station_name;
 
	const char *grf;
 
	uint64 dparam[2];
 
};
 

	
src/town_cmd.cpp
Show inline comments
 
@@ -616,12 +616,19 @@ static void GetAcceptedCargo_Town(TileIn
 

	
 
static void GetTileDesc_Town(TileIndex tile, TileDesc *td)
 
{
 
	td->str = GetHouseSpecs(GetHouseType(tile))->building_name;
 
	const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile));
 

	
 
	td->str = hs->building_name;
 
	if (!IsHouseCompleted(tile)) {
 
		SetDParamX(td->dparam, 0, td->str);
 
		td->str = STR_2058_UNDER_CONSTRUCTION;
 
	}
 

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

	
 
	td->owner[0] = OWNER_TOWN;
 
}
 

	
0 comments (0 inline, 0 general)