diff options
author | peter1138 <peter1138@openttd.org> | 2008-01-27 11:01:10 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-01-27 11:01:10 +0000 |
commit | 0847def759cd8c07d880387779d2d54cdc5382f8 (patch) | |
tree | 0e1beb3106f8e27722ec2f9a2861a662e09a4207 /src/misc_gui.cpp | |
parent | 7b29dcde3cef3d91dd23b3378736f378c028a16e (diff) | |
download | openttd-0847def759cd8c07d880387779d2d54cdc5382f8.tar.xz |
(svn r11993) -Fix: Resize station/roadstop/dock/airport construction windows if cargo acceptance list is too long.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 8ef6d5f3f..aa4a96902 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -773,7 +773,7 @@ void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[ } -static void DrawStationCoverageText(const AcceptedCargo accepts, +static int DrawStationCoverageText(const AcceptedCargo accepts, int str_x, int str_y, StationCoverageType sct) { char *b = _userstring; @@ -809,17 +809,19 @@ static void DrawStationCoverageText(const AcceptedCargo accepts, /* Make sure we detect any buffer overflow */ assert(b < endof(_userstring)); - DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144); + return DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144); } -void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad) +int DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad) { TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y); AcceptedCargo accepts; if (tile < MapSize()) { GetAcceptanceAroundTiles(accepts, tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE , rad); - DrawStationCoverageText(accepts, sx, sy, sct); + return sy + DrawStationCoverageText(accepts, sx, sy, sct); } + + return sy; } void CheckRedrawStationCoverage(const Window *w) |