diff options
author | belugas <belugas@openttd.org> | 2008-05-24 02:54:47 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2008-05-24 02:54:47 +0000 |
commit | fc35ad9ee9077869ab7b5a06b44327c835df3e5f (patch) | |
tree | 6e9667beb04ac4a18b43294a74456ab52a123a5a /src/airport_gui.cpp | |
parent | 6f233b1f8f18beb1e347c943685f6086d886993e (diff) | |
download | openttd-fc35ad9ee9077869ab7b5a06b44327c835df3e5f.tar.xz |
(svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
Initial concept : TTDPatch (moreairpots), Initial code : Pasky
Thanks to BigBB (help coding), Smatz Skidd13 and frosch for bugcatches and advices
Diffstat (limited to 'src/airport_gui.cpp')
-rw-r--r-- | src/airport_gui.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 5bf5ec97a..db0f2b8ee 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -12,6 +12,7 @@ #include "airport.h" #include "sound_func.h" #include "window_func.h" +#include "strings_func.h" #include "settings_type.h" #include "viewport_func.h" #include "gfx_func.h" @@ -177,12 +178,17 @@ public: this->SetWidgetLoweredState(BAW_BTN_DOHILIGHT, _station_show_coverage); this->LowerWidget(_selected_airport_type + BAW_SMALL_AIRPORT); + if (_patches.station_noise_level) { + ResizeWindowForWidget(this, BAW_BOTTOMPANEL, 0, 10); + } + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() { int i; // airport enabling loop + uint16 y_noise_offset = 0; uint32 avail_airports; const AirportFTAClass *airport; @@ -210,8 +216,17 @@ public: if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad); this->DrawWidgets(); + + /* only show the station (airport) noise, if the noise option is activated */ + if (_patches.station_noise_level) { + /* show the noise of the selected airport */ + SetDParam(0, airport->noise_level); + DrawString(2, 206, STR_STATION_NOISE, 0); + y_noise_offset = 10; + } + /* strings such as 'Size' and 'Coverage Area' */ - int text_end = DrawStationCoverageAreaText(2, 206, SCT_ALL, rad, false); + int text_end = DrawStationCoverageAreaText(2, this->widget[BAW_BTN_DOHILIGHT].bottom + 4 + y_noise_offset, SCT_ALL, rad, false); text_end = DrawStationCoverageAreaText(2, text_end + 4, SCT_ALL, rad, true) + 4; if (text_end != this->widget[BAW_BOTTOMPANEL].bottom) { this->SetDirty(); |