|
@@ -112,24 +112,45 @@ public:
|
|
|
if (i == 0) size->height += 4;
|
|
|
}
|
|
|
|
|
|
if (!StrEmpty(this->landinfo_data[LAND_INFO_MULTICENTER_LINE])) {
|
|
|
uint width = GetStringBoundingBox(this->landinfo_data[LAND_INFO_MULTICENTER_LINE]).width + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT;
|
|
|
size->width = max(size->width, min(300u, width));
|
|
|
SetDParamStr(0, this->landinfo_data[LAND_INFO_MULTICENTER_LINE]);
|
|
|
size->height += GetStringHeight(STR_JUST_RAW_STRING, size->width - WD_FRAMETEXT_LEFT - WD_FRAMETEXT_RIGHT);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
LandInfoWindow(TileIndex tile) : Window(), tile(tile) {
|
|
|
this->InitNested(&_land_info_desc);
|
|
|
|
|
|
#if defined(_DEBUG)
|
|
|
# define LANDINFOD_LEVEL 0
|
|
|
#else
|
|
|
# define LANDINFOD_LEVEL 1
|
|
|
#endif
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "TILE: %#x (%i,%i)", tile, TileX(tile), TileY(tile));
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "type_height = %#x", _m[tile].type_height);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m1 = %#x", _m[tile].m1);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m2 = %#x", _m[tile].m2);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m3 = %#x", _m[tile].m3);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m4 = %#x", _m[tile].m4);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m5 = %#x", _m[tile].m5);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m6 = %#x", _m[tile].m6);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m7 = %#x", _me[tile].m7);
|
|
|
#undef LANDINFOD_LEVEL
|
|
|
}
|
|
|
|
|
|
virtual void OnInit()
|
|
|
{
|
|
|
Town *t = ClosestTownFromTile(tile, _settings_game.economy.dist_local_authority);
|
|
|
|
|
|
/* Because build_date is not set yet in every TileDesc, we make sure it is empty */
|
|
|
TileDesc td;
|
|
|
|
|
|
td.build_date = INVALID_DATE;
|
|
|
|
|
|
/* Most tiles have only one owner, but
|
|
|
* - drivethrough roadstops can be build on town owned roads (up to 2 owners) and
|
|
|
* - roads can have up to four owners (railroad, road, tram, 3rd-roadtype "highway").
|
|
|
*/
|
|
|
td.owner_type[0] = STR_LAND_AREA_INFORMATION_OWNER; // At least one owner is displayed, though it might be "N/A".
|
|
@@ -288,42 +309,24 @@ public:
|
|
|
|
|
|
/* If the accepted value is less than 8, show it in 1/8:ths */
|
|
|
if (acceptance[i] < 8) {
|
|
|
SetDParam(0, acceptance[i]);
|
|
|
SetDParam(1, CargoSpec::Get(i)->name);
|
|
|
strp = GetString(strp, STR_LAND_AREA_INFORMATION_CARGO_EIGHTS, lastof(this->landinfo_data[LAND_INFO_MULTICENTER_LINE]));
|
|
|
} else {
|
|
|
strp = GetString(strp, CargoSpec::Get(i)->name, lastof(this->landinfo_data[LAND_INFO_MULTICENTER_LINE]));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (!found) this->landinfo_data[LAND_INFO_MULTICENTER_LINE][0] = '\0';
|
|
|
|
|
|
this->InitNested(&_land_info_desc);
|
|
|
|
|
|
#if defined(_DEBUG)
|
|
|
# define LANDINFOD_LEVEL 0
|
|
|
#else
|
|
|
# define LANDINFOD_LEVEL 1
|
|
|
#endif
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "TILE: %#x (%i,%i)", tile, TileX(tile), TileY(tile));
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "type_height = %#x", _m[tile].type_height);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m1 = %#x", _m[tile].m1);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m2 = %#x", _m[tile].m2);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m3 = %#x", _m[tile].m3);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m4 = %#x", _m[tile].m4);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m5 = %#x", _m[tile].m5);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m6 = %#x", _m[tile].m6);
|
|
|
DEBUG(misc, LANDINFOD_LEVEL, "m7 = %#x", _me[tile].m7);
|
|
|
#undef LANDINFOD_LEVEL
|
|
|
}
|
|
|
|
|
|
virtual bool IsNewGRFInspectable() const
|
|
|
{
|
|
|
return ::IsNewGRFInspectable(GetGrfSpecFeature(this->tile), this->tile);
|
|
|
}
|
|
|
|
|
|
virtual void ShowNewGRFInspectWindow() const
|
|
|
{
|
|
|
::ShowNewGRFInspectWindow(GetGrfSpecFeature(this->tile), this->tile);
|
|
|
}
|
|
|
};
|