src/airport_gui.cpp
branchNewGRF_ports
changeset 10991 d8811e327d12
parent 10731 67db0d431d5e
--- a/src/airport_gui.cpp	Tue May 27 00:50:55 2008 +0000
+++ b/src/airport_gui.cpp	Tue Jun 17 10:32:49 2008 +0000
@@ -90,12 +90,12 @@
 	BuildAirToolbarWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
 	{
 		this->FindWindowPlacementAndResize(desc);
-		if (_settings.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
+		if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
 	}
 
 	~BuildAirToolbarWindow()
 	{
-		if (_settings.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
+		if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
 	}
 
 	virtual void OnPaint()
@@ -201,7 +201,7 @@
 		_airport.direction = DIR_NE;
 		_airport.station_count = GetNumCustomFSMports(_airport.fsmports_class);
 
-		if (_settings.economy.station_noise_level) {
+		if (_settings_game.economy.station_noise_level) {
 			ResizeWindowForWidget(this, BAPW_BACKGROUND, 0, 10);
 		}
 
@@ -261,10 +261,18 @@
 		}
 
 		SetDParam(0, GetFSMportsClassName(_airport.fsmports_class));
-		this->DrawWidgets();
 
 		/* strings such as 'Size' and 'Coverage Area' */
 
+		this->DrawWidgets();
+
+		/* only show the station (airport) noise, if the noise option is activated */
+		if (_settings_game.economy.station_noise_level) {
+			/* show the noise of the selected airport */
+			SetDParam(0, fsmportspec->portFSM->noise_level);
+			DrawString(2, 206, STR_STATION_NOISE, 0);
+			y_noise_offset = 10;
+		}
 		if (_airport.station_type != 0xFF) {
 			/* draw the preview image if the station is available */
 			if (!HasBit(fsmportspec->callbackmask, CBM_STATION_AVAIL) || GetFSMportsCallback(CBID_STATION_AVAILABILITY, 0, 0, fsmportspec, NULL, INVALID_TILE) != 0) {
@@ -273,10 +281,11 @@
 			_thd.FSMportLayout = &fsmportspec->layouts[_airport.layout_set];  // irregular airport support
 			_thd.FSMportMask = NULL;
 			if (fsmportspec->layout_mask != NULL) _thd.FSMportMask = &fsmportspec->layout_mask[_airport.layout_set];  // irregular airport support
-			int rad = _settings.station.modified_catchment ? fsmportspec->portFSM->catchment : 4;
+			int rad = _settings_game.station.modified_catchment ? fsmportspec->portFSM->catchment : 4;
 			if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
-			int text_end = DrawStationCoverageAreaText(2, 206, SCT_ALL, rad, false);
-			text_end = DrawStationCoverageAreaText(2, text_end + 4, SCT_ALL, rad, true) + 4;
+			//int text_end = DrawStationCoverageAreaText(2, 206, SCT_ALL, rad, false);
+			//text_end = DrawStationCoverageAreaText(2, text_end + 4, SCT_ALL, rad, true) + 4;
+			int text_end = DrawStationCoverageAreaText(2, this->widget[BAPW_HIGHLIGHT_ON].bottom + 4 + y_noise_offset, SCT_ALL, rad, false);
 			if (text_end > this->widget[BAPW_BACKGROUND].bottom) {
 				this->SetDirty();
 				ResizeWindowForWidget(this, BAPW_BACKGROUND, 0, text_end - this->widget[BAPW_BACKGROUND].bottom);