mirror of https://github.com/OpenTTD/OpenTTD
(svn r16787) -Fix [FS#3027]: the noise level text in the airport build window was drawn over the lowest button
parent
abc4f9b9a0
commit
024a2eeed5
|
@ -228,21 +228,21 @@ public:
|
||||||
const AirportFTAClass *airport = GetAirport(_selected_airport_type);
|
const AirportFTAClass *airport = GetAirport(_selected_airport_type);
|
||||||
int rad = _settings_game.station.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
|
int rad = _settings_game.station.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
|
||||||
|
|
||||||
uint16 y_noise_offset = 0;
|
uint16 top = this->widget[BAW_BTN_DOHILIGHT].bottom + WD_PAR_VSEP_NORMAL;
|
||||||
/* only show the station (airport) noise, if the noise option is activated */
|
/* only show the station (airport) noise, if the noise option is activated */
|
||||||
if (_settings_game.economy.station_noise_level) {
|
if (_settings_game.economy.station_noise_level) {
|
||||||
/* show the noise of the selected airport */
|
/* show the noise of the selected airport */
|
||||||
SetDParam(0, airport->noise_level);
|
SetDParam(0, airport->noise_level);
|
||||||
DrawString(2, this->width - 2, 206, STR_STATION_NOISE);
|
DrawString(WD_FRAMERECT_LEFT, this->width - WD_FRAMERECT_RIGHT, top, STR_STATION_NOISE);
|
||||||
y_noise_offset = 10;
|
top += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* strings such as 'Size' and 'Coverage Area' */
|
/* strings such as 'Size' and 'Coverage Area' */
|
||||||
int text_end = DrawStationCoverageAreaText(2, this->widget[BAW_BTN_DOHILIGHT].bottom + 4 + y_noise_offset, SCT_ALL, rad, false);
|
top = DrawStationCoverageAreaText(WD_FRAMERECT_LEFT, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
|
||||||
text_end = DrawStationCoverageAreaText(2, text_end + 4, SCT_ALL, rad, true) + 4;
|
top = DrawStationCoverageAreaText(WD_FRAMERECT_LEFT, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
|
||||||
if (text_end != this->widget[BAW_BOTTOMPANEL].bottom) {
|
if (top != this->widget[BAW_BOTTOMPANEL].bottom) {
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
ResizeWindowForWidget(this, BAW_BOTTOMPANEL, 0, text_end - this->widget[BAW_BOTTOMPANEL].bottom);
|
ResizeWindowForWidget(this, BAW_BOTTOMPANEL, 0, top - this->widget[BAW_BOTTOMPANEL].bottom);
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,8 @@ enum WidgetDrawDistances {
|
||||||
WD_DROPDOWNTEXT_TOP = 1, ///< Top offset of the dropdown widget string.
|
WD_DROPDOWNTEXT_TOP = 1, ///< Top offset of the dropdown widget string.
|
||||||
|
|
||||||
WD_SORTBUTTON_ARROW_WIDTH = 11, ///< Width of up/down arrow of sort button state.
|
WD_SORTBUTTON_ARROW_WIDTH = 11, ///< Width of up/down arrow of sort button state.
|
||||||
|
|
||||||
|
WD_PAR_VSEP_NORMAL = 2, ///< Amount of vertical space between two paragraphs of text.
|
||||||
};
|
};
|
||||||
|
|
||||||
/* wiget.cpp */
|
/* wiget.cpp */
|
||||||
|
|
Loading…
Reference in New Issue