src/airport_gui.cpp
changeset 9413 7042a8ec3fa8
parent 9354 845e07db4549
child 9652 0405e98d8e96
equal deleted inserted replaced
9412:163c465bf250 9413:7042a8ec3fa8
    68 
    68 
    69 struct BuildAirToolbarWindow : Window {
    69 struct BuildAirToolbarWindow : Window {
    70 	BuildAirToolbarWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
    70 	BuildAirToolbarWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
    71 	{
    71 	{
    72 		this->FindWindowPlacementAndResize(desc);
    72 		this->FindWindowPlacementAndResize(desc);
    73 		if (_settings.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
    73 		if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
    74 	}
    74 	}
    75 
    75 
    76 	~BuildAirToolbarWindow()
    76 	~BuildAirToolbarWindow()
    77 	{
    77 	{
    78 		if (_settings.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
    78 		if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
    79 	}
    79 	}
    80 
    80 
    81 	virtual void OnPaint()
    81 	virtual void OnPaint()
    82 	{
    82 	{
    83 		this->DrawWidgets();
    83 		this->DrawWidgets();
   176 	{
   176 	{
   177 		this->SetWidgetLoweredState(BAW_BTN_DONTHILIGHT, !_station_show_coverage);
   177 		this->SetWidgetLoweredState(BAW_BTN_DONTHILIGHT, !_station_show_coverage);
   178 		this->SetWidgetLoweredState(BAW_BTN_DOHILIGHT, _station_show_coverage);
   178 		this->SetWidgetLoweredState(BAW_BTN_DOHILIGHT, _station_show_coverage);
   179 		this->LowerWidget(_selected_airport_type + BAW_SMALL_AIRPORT);
   179 		this->LowerWidget(_selected_airport_type + BAW_SMALL_AIRPORT);
   180 
   180 
   181 		if (_settings.economy.station_noise_level) {
   181 		if (_settings_game.economy.station_noise_level) {
   182 			ResizeWindowForWidget(this, BAW_BOTTOMPANEL, 0, 10);
   182 			ResizeWindowForWidget(this, BAW_BOTTOMPANEL, 0, 10);
   183 		}
   183 		}
   184 
   184 
   185 		this->FindWindowPlacementAndResize(desc);
   185 		this->FindWindowPlacementAndResize(desc);
   186 	}
   186 	}
   209 
   209 
   210 		/* select default the coverage area to 'Off' (16) */
   210 		/* select default the coverage area to 'Off' (16) */
   211 		airport = GetAirport(_selected_airport_type);
   211 		airport = GetAirport(_selected_airport_type);
   212 		SetTileSelectSize(airport->size_x, airport->size_y);
   212 		SetTileSelectSize(airport->size_x, airport->size_y);
   213 
   213 
   214 		int rad = _settings.station.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
   214 		int rad = _settings_game.station.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
   215 
   215 
   216 		if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
   216 		if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
   217 
   217 
   218 		this->DrawWidgets();
   218 		this->DrawWidgets();
   219 
   219 
   220 		/* only show the station (airport) noise, if the noise option is activated */
   220 		/* only show the station (airport) noise, if the noise option is activated */
   221 		if (_settings.economy.station_noise_level) {
   221 		if (_settings_game.economy.station_noise_level) {
   222 			/* show the noise of the selected airport */
   222 			/* show the noise of the selected airport */
   223 			SetDParam(0, airport->noise_level);
   223 			SetDParam(0, airport->noise_level);
   224 			DrawString(2, 206, STR_STATION_NOISE, 0);
   224 			DrawString(2, 206, STR_STATION_NOISE, 0);
   225 			y_noise_offset = 10;
   225 			y_noise_offset = 10;
   226 		}
   226 		}