771 w->widget[0].right = br.width; |
771 w->widget[0].right = br.width; |
772 w->widget[0].bottom = br.height; |
772 w->widget[0].bottom = br.height; |
773 } |
773 } |
774 |
774 |
775 |
775 |
776 static void DrawStationCoverageText(const AcceptedCargo accepts, |
776 static int DrawStationCoverageText(const AcceptedCargo accepts, |
777 int str_x, int str_y, StationCoverageType sct) |
777 int str_x, int str_y, StationCoverageType sct) |
778 { |
778 { |
779 char *b = _userstring; |
779 char *b = _userstring; |
780 bool first = true; |
780 bool first = true; |
781 |
781 |
807 *b = '\0'; |
807 *b = '\0'; |
808 |
808 |
809 /* Make sure we detect any buffer overflow */ |
809 /* Make sure we detect any buffer overflow */ |
810 assert(b < endof(_userstring)); |
810 assert(b < endof(_userstring)); |
811 |
811 |
812 DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144); |
812 return DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144); |
813 } |
813 } |
814 |
814 |
815 void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad) |
815 int DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad) |
816 { |
816 { |
817 TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y); |
817 TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y); |
818 AcceptedCargo accepts; |
818 AcceptedCargo accepts; |
819 if (tile < MapSize()) { |
819 if (tile < MapSize()) { |
820 GetAcceptanceAroundTiles(accepts, tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE , rad); |
820 GetAcceptanceAroundTiles(accepts, tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE , rad); |
821 DrawStationCoverageText(accepts, sx, sy, sct); |
821 return sy + DrawStationCoverageText(accepts, sx, sy, sct); |
822 } |
822 } |
|
823 |
|
824 return sy; |
823 } |
825 } |
824 |
826 |
825 void CheckRedrawStationCoverage(const Window *w) |
827 void CheckRedrawStationCoverage(const Window *w) |
826 { |
828 { |
827 if (_thd.dirty & 1) { |
829 if (_thd.dirty & 1) { |
1687 static const StringID saveload_captions[] = { |
1689 static const StringID saveload_captions[] = { |
1688 STR_4001_LOAD_GAME, |
1690 STR_4001_LOAD_GAME, |
1689 STR_0298_LOAD_SCENARIO, |
1691 STR_0298_LOAD_SCENARIO, |
1690 STR_4000_SAVE_GAME, |
1692 STR_4000_SAVE_GAME, |
1691 STR_0299_SAVE_SCENARIO, |
1693 STR_0299_SAVE_SCENARIO, |
1692 STR_4011_LOAD_HEIGHTMAP, |
1694 STR_LOAD_HEIGHTMAP, |
1693 }; |
1695 }; |
1694 |
1696 |
1695 Window *w; |
1697 Window *w; |
1696 const WindowDesc *sld = &_save_dialog_desc; |
1698 const WindowDesc *sld = &_save_dialog_desc; |
1697 |
1699 |