summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-07-10 00:59:00 +0000
committerbelugas <belugas@openttd.org>2007-07-10 00:59:00 +0000
commita5da0e66099f53fba150438fee5ddcde0f3bdfcd (patch)
tree4473d88c6a3b8ad2af3b48c67c80571693682ba9
parentb690bef8782233030228e7cabd9fd02f289ce1ae (diff)
downloadopenttd-a5da0e66099f53fba150438fee5ddcde0f3bdfcd.tar.xz
(svn r10496) -Feature: Replace all the windows for Industry building by a more flexible one.
Thanks to Csaboka (from TTDPatch dev team) for his hints and original design (which i've found while it was halfway done, so i could make it more compliant ;)). Don't expect it to be a carbon-copy though. A few differences can be found here and there. Thanks to Rubidium for his helping hand. Hope you will like it as we do :)
-rw-r--r--src/industry_gui.cpp498
-rw-r--r--src/lang/american.txt2
-rw-r--r--src/lang/brazilian_portuguese.txt2
-rw-r--r--src/lang/bulgarian.txt2
-rw-r--r--src/lang/catalan.txt2
-rw-r--r--src/lang/croatian.txt2
-rw-r--r--src/lang/czech.txt2
-rw-r--r--src/lang/danish.txt2
-rw-r--r--src/lang/dutch.txt2
-rw-r--r--src/lang/english.txt11
-rw-r--r--src/lang/esperanto.txt2
-rw-r--r--src/lang/estonian.txt2
-rw-r--r--src/lang/finnish.txt2
-rw-r--r--src/lang/french.txt2
-rw-r--r--src/lang/galician.txt2
-rw-r--r--src/lang/german.txt2
-rw-r--r--src/lang/hungarian.txt2
-rw-r--r--src/lang/icelandic.txt2
-rw-r--r--src/lang/italian.txt2
-rw-r--r--src/lang/japanese.txt2
-rw-r--r--src/lang/korean.txt2
-rw-r--r--src/lang/lithuanian.txt2
-rw-r--r--src/lang/norwegian_bokmal.txt2
-rw-r--r--src/lang/norwegian_nynorsk.txt2
-rw-r--r--src/lang/piglatin.txt2
-rw-r--r--src/lang/polish.txt2
-rw-r--r--src/lang/portuguese.txt2
-rw-r--r--src/lang/romanian.txt2
-rw-r--r--src/lang/russian.txt2
-rw-r--r--src/lang/simplified_chinese.txt2
-rw-r--r--src/lang/slovak.txt2
-rw-r--r--src/lang/slovenian.txt2
-rw-r--r--src/lang/spanish.txt2
-rw-r--r--src/lang/swedish.txt2
-rw-r--r--src/lang/traditional_chinese.txt2
-rw-r--r--src/lang/turkish.txt2
-rw-r--r--src/lang/ukrainian.txt2
-rw-r--r--src/lang/unfinished/afrikaans.txt2
-rw-r--r--src/lang/unfinished/greek.txt3
-rw-r--r--src/lang/unfinished/latvian.txt2
-rw-r--r--src/main_gui.cpp238
41 files changed, 329 insertions, 495 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 9da1fb78f..054d0de17 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -25,262 +25,322 @@
#include "newgrf_industries.h"
#include "newgrf_text.h"
-/* industries per climate, according to the different construction windows */
-const byte _build_industry_types[4][12] = {
- { 1, 2, 4, 6, 8, 0, 3, 5, 9, 11, 18 },
- { 1, 14, 4, 13, 7, 0, 3, 9, 11, 15 },
- { 25, 13, 4, 23, 22, 11, 17, 10, 24, 19, 20, 21 },
- { 27, 30, 31, 33, 26, 28, 29, 32, 34, 35, 36 },
+extern Industry *CreateNewIndustry(TileIndex tile, IndustryType type);
+
+/**
+ * Search callback function for TryBuildIndustry
+ * @param tile to test
+ * @param data that is passed by the caller. In this case, the type of industry been tested
+ * @return the success (or not) of the operation
+ */
+static bool SearchTileForIndustry(TileIndex tile, uint32 data)
+{
+ return CreateNewIndustry(tile, data) != NULL;
+}
+
+/**
+ * Perform a 9*9 tiles circular search around a tile
+ * in order to find a suitable zone to create the desired industry
+ * @param tile to start search for
+ * @param type of the desired industry
+ * @return the success (or not) of the operation
+ */
+static bool TryBuildIndustry(TileIndex tile, int type)
+{
+ return CircularTileSearch(tile, 9, SearchTileForIndustry, type);
+}
+bool _ignore_restrictions;
+
+enum {
+ DYNA_INDU_MATRIX_WIDGET = 2,
+ DYNA_INDU_INFOPANEL = 4,
+ DYNA_INDU_FUND_WIDGET,
+ DYNA_INDU_RESIZE_WIDGET,
};
-static void UpdateIndustryProduction(Industry *i);
+static struct IndustryData {
+ uint16 count;
+ IndustryType select;
+ byte index[NUM_INDUSTRYTYPES + 1];
+ StringID additional_text[NUM_INDUSTRYTYPES + 1];
+} _industrydata;
-static void BuildIndustryWndProc(Window *w, WindowEvent *e)
+static void BuildDynamicIndustryWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
- case WE_PAINT:
- DrawWindowWidgets(w);
- if (_thd.place_mode == 1 && _thd.window_class == WC_BUILD_INDUSTRY) {
- int ind_type = _build_industry_types[_opt_ptr->landscape][WP(w, def_d).data_1];
+ case WE_CREATE: {
+ IndustryType ind;
+ const IndustrySpec *indsp;
+
+ /* Shorten the window to the equivalant of the additionnal purchase
+ * info coming from the callback. SO it will only be available to tis full
+ * height when newindistries are loaded */
+ if (!_loaded_newgrf_features.has_newindustries) {
+ w->widget[DYNA_INDU_INFOPANEL].bottom -= 44;
+ w->widget[DYNA_INDU_FUND_WIDGET].bottom -= 44;
+ w->widget[DYNA_INDU_FUND_WIDGET].top -= 44;
+ w->widget[DYNA_INDU_RESIZE_WIDGET].bottom -= 44;
+ w->widget[DYNA_INDU_RESIZE_WIDGET].top -= 44;
+ w->resize.height = w->height -= 44;
+ }
- SetDParam(0, GetIndustrySpec(ind_type)->GetConstructionCost());
- DrawStringCentered(85, w->height - 21, STR_482F_COST, 0);
- }
- break;
+ /* Initilialize structures */
+ memset(&_industrydata.index, 0xFF, NUM_INDUSTRYTYPES);
+ memset(&_industrydata.additional_text, STR_NULL, NUM_INDUSTRYTYPES);
+ _industrydata.count = 0;
- case WE_CLICK: {
- int wid = e->we.click.widget;
- if (wid >= 3) {
- if (HandlePlacePushButton(w, wid, SPR_CURSOR_INDUSTRY, 1, NULL))
- WP(w, def_d).data_1 = wid - 3;
- }
- } break;
+ /* first indutry type is selected.
+ * I'll be damned if there are none available ;) */
+ _industrydata.select = 0;
+ w->vscroll.cap = 8; // rows in grid, same in scroller
+ w->resize.step_height = 13;
- case WE_PLACE_OBJ:
- if (DoCommandP(e->we.place.tile, _build_industry_types[_opt_ptr->landscape][WP(w, def_d).data_1], 0, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY)))
- ResetObjectToPlace();
- break;
+ if (_game_mode == GM_EDITOR) { // give room for the Many Random "button"
+ _industrydata.index[_industrydata.count] = INVALID_INDUSTRYTYPE;
+ _industrydata.count++;
+ }
- case WE_ABORT_PLACE_OBJ:
- RaiseWindowButtons(w);
- break;
- }
-}
+ /* We'll perform two distinct loops, one for secondary industries, and the other one for
+ * primary ones. Each loop will fill the _industrydata structure. */
+ for (ind = IT_COAL_MINE; ind < NUM_INDUSTRYTYPES; ind++) {
+ indsp = GetIndustrySpec(ind);
+ if (indsp->enabled && (!indsp->IsRawIndustry() || _game_mode == GM_EDITOR)) {
+ _industrydata.index[_industrydata.count] = ind;
+ _industrydata.count++;
+ }
+ }
-static const Widget _build_industry_land0_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 115, 0x0, STR_NULL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 29, 40, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL},
-{ WIDGETS_END},
-};
+ if (_patches.raw_industry_construction != 0 && _game_mode != GM_EDITOR) {
+ for (ind = IT_COAL_MINE; ind < NUM_INDUSTRYTYPES; ind++) {
+ indsp = GetIndustrySpec(ind);
+ if (indsp->enabled && indsp->IsRawIndustry()) {
+ _industrydata.index[_industrydata.count] = ind;
+ _industrydata.count++;
+ }
+ }
+ }
+ } break;
-static const Widget _build_industry_land1_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 115, 0x0, STR_NULL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 29, 40, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS},
-{ WIDGETS_END},
-};
+ case WE_PAINT: {
+ const IndustrySpec *indsp = (_industrydata.index[_industrydata.select] == INVALID_INDUSTRYTYPE) ? NULL : GetIndustrySpec(_industrydata.index[_industrydata.select]);
+ StringID str = STR_4827_REQUIRES;
+ int x_str = w->widget[DYNA_INDU_INFOPANEL].left + 3;
+ int y_str = w->widget[DYNA_INDU_INFOPANEL].top + 3;
+ const Widget *wi = &w->widget[DYNA_INDU_INFOPANEL];
+ int max_width = wi->right - wi->left - 4;
+
+ /* Raw industries might be prospected. Show this fact by changing the string */
+ if (_game_mode == GM_EDITOR) {
+ w->widget[DYNA_INDU_FUND_WIDGET].data = STR_BUILD_NEW_INDUSTRY;
+ } else {
+ w->widget[DYNA_INDU_FUND_WIDGET].data = (_patches.raw_industry_construction == 2 && indsp->IsRawIndustry()) ? STR_PROSPECT_NEW_INDUSTRY : STR_FUND_NEW_INDUSTRY;
+ }
-static const Widget _build_industry_land2_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 115, 0x0, STR_NULL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 29, 40, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN},
-{ WIDGETS_END},
-};
+ SetVScrollCount(w, _industrydata.count);
-static const Widget _build_industry_land3_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 115, 0x0, STR_NULL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 29, 40, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_025E_FIZZY_DRINK_FACTORY, STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY},
-{ WIDGETS_END},
-};
+ DrawWindowWidgets(w);
-static const Widget _build_industry_land0_widgets_extra[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 187, 0x0, STR_NULL},
+ /* and now with the matrix painting */
+ for (byte i = 0; i < w->vscroll.cap && ((i + w->vscroll.pos) < _industrydata.count); i++) {
+ int offset = i * 13;
+ int x = 3;
+ int y = 16;
+ bool selected = _industrydata.select == i + w->vscroll.pos;
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 29, 40, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL},
+ if (_industrydata.index[i + w->vscroll.pos] == INVALID_INDUSTRYTYPE) {
+ DrawString(21, y + offset, STR_MANY_RANDOM_INDUSTRIES, selected ? 12 : 6);
+ continue;
+ }
+ const IndustrySpec *indsp = GetIndustrySpec(_industrydata.index[i + w->vscroll.pos]);
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 84, 95, STR_0240_COAL_MINE, STR_CONSTRUCT_COAL_MINE_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 97, 108, STR_0243_FOREST, STR_CONSTRUCT_FOREST_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 110, 121, STR_0245_OIL_RIG, STR_CONSTRUCT_OIL_RIG_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 123, 134, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 136, 147, STR_024A_OIL_WELLS, STR_CONSTRUCT_OIL_WELLS_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 149, 160, STR_0249_IRON_ORE_MINE, STR_CONSTRUCT_IRON_ORE_MINE_TIP},
+ /* Draw the name of the industry in white is selected, otherwise, in orange */
+ DrawString(20, y + offset, indsp->name, selected ? 12 : 6);
+ GfxFillRect(x, y + 1 + offset, x + 10, y + 7 + offset, selected ? 15 : 0);
+ GfxFillRect(x + 1, y + 2 + offset, x + 9, y + 6 + offset, indsp->map_colour);
+ }
-{ WIDGETS_END},
-};
+ if (_industrydata.index[_industrydata.select] == INVALID_INDUSTRYTYPE) {
+ DrawStringMultiLine(x_str, y_str, STR_RANDOM_INDUSTRIES_TIP, max_width, wi->bottom - wi->top - 40);
+ break;
+ }
-static const Widget _build_industry_land1_widgets_extra[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 174, 0x0, STR_NULL},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 29, 40, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 84, 95, STR_0240_COAL_MINE, STR_CONSTRUCT_COAL_MINE_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 97, 108, STR_0243_FOREST, STR_CONSTRUCT_FOREST_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 110, 121, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 123, 134, STR_024A_OIL_WELLS, STR_CONSTRUCT_OIL_WELLS_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 136, 147, STR_024F_GOLD_MINE, STR_CONSTRUCT_GOLD_MINE_TIP},
-{ WIDGETS_END},
-};
+ if (_game_mode != GM_EDITOR) {
+ SetDParam(0, indsp->GetConstructionCost());
+ DrawStringTruncated(x_str, y_str, STR_482F_COST, 0, max_width);
+ y_str += 11;
+ }
-static const Widget _build_industry_land2_widgets_extra[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 200, 0x0, STR_NULL},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 29, 40, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 84, 95, STR_024A_OIL_WELLS, STR_CONSTRUCT_OIL_WELLS_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 97, 108, STR_0255_DIAMOND_MINE, STR_CONSTRUCT_DIAMOND_MINE_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 110, 121, STR_0256_COPPER_ORE_MINE, STR_CONSTRUCT_COPPER_ORE_MINE_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 123, 134, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 136, 147, STR_0251_FRUIT_PLANTATION, STR_CONSTRUCT_FRUIT_PLANTATION_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 149, 160, STR_0252_RUBBER_PLANTATION, STR_CONSTRUCT_RUBBER_PLANTATION_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 162, 173, STR_0253_WATER_SUPPLY, STR_CONSTRUCT_WATER_SUPPLY_TIP},
-{ WIDGETS_END},
-};
+ /* Draw the accepted cargos, if any. Otherwhise, will print "Nothing" */
+ if (indsp->accepts_cargo[0] != CT_INVALID) {
+ SetDParam(0, GetCargo(indsp->accepts_cargo[0])->name);
+ if (indsp->accepts_cargo[1] != CT_INVALID) {
+ SetDParam(1, GetCargo(indsp->accepts_cargo[1])->name);
+ str = STR_4828_REQUIRES;
+ if (indsp->accepts_cargo[2] != CT_INVALID) {
+ SetDParam(2, GetCargo(indsp->accepts_cargo[2])->name);
+ str = STR_4829_REQUIRES;
+ }
+ }
+ } else {
+ SetDParam(0, STR_00D0_NOTHING);
+ }
+ DrawStringTruncated(x_str, y_str, str, 0, max_width);
+
+ y_str += 11;
+ /* Draw the produced cargos, if any. Otherwhise, will print "Nothing" */
+ str = STR_4827_PRODUCES;
+ if (indsp->produced_cargo[0] != CT_INVALID) {
+ SetDParam(0, GetCargo(indsp->produced_cargo[0])->name);
+ if (indsp->produced_cargo[1] != CT_INVALID) {
+ SetDParam(1, GetCargo(indsp->produced_cargo[1])->name);
+ str = STR_4828_PRODUCES;
+ }
+ } else {
+ SetDParam(0, STR_00D0_NOTHING);
+ }
+ DrawStringTruncated(x_str, y_str, str, 0, max_width);
+
+ /* Get the additional purchase info text, if it has not already been */
+ if (_industrydata.additional_text[_industrydata.select] == STR_NULL) { // Have i been called already?
+ if (HASBIT(indsp->callback_flags, CBM_IND_FUND_MORE_TEXT)) { // No. Can it be called?
+ uint16 callback_res = GetIndustryCallback(CBID_INDUSTRY_FUND_MORE_TEXT, 0, 0, NULL, _industrydata.index[_industrydata.select], INVALID_TILE);
+ if (callback_res != CALLBACK_FAILED) { // Did it failed?
+ StringID newtxt = GetGRFStringID(indsp->grf_prop.grffile->grfid, 0xD000 + callback_res); // No. here's the new string
+ _industrydata.additional_text[_industrydata.select] = newtxt; // Store it for further usage
+ }
+ }
+ }
-static const Widget _build_industry_land3_widgets_extra[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 187, 0x0, STR_NULL},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 29, 40, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_025E_FIZZY_DRINK_FACTORY, STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 71, 82, STR_0257_COTTON_CANDY_FOREST, STR_CONSTRUCT_COTTON_CANDY_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 84, 95, STR_0259_BATTERY_FARM, STR_CONSTRUCT_BATTERY_FARM_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 97, 108, STR_025A_COLA_WELLS, STR_CONSTRUCT_COLA_WELLS_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 110, 121, STR_025D_PLASTIC_FOUNTAINS, STR_CONSTRUCT_PLASTIC_FOUNTAINS_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 123, 134, STR_025F_BUBBLE_GENERATOR, STR_CONSTRUCT_BUBBLE_GENERATOR_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 136, 147, STR_0260_TOFFEE_QUARRY, STR_CONSTRUCT_TOFFEE_QUARRY_TIP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 149, 160, STR_0261_SUGAR_MINE, STR_CONSTRUCT_SUGAR_MINE_TIP},
-{ WIDGETS_END},
-};
+ y_str += 11;
+ /* Draw the Additional purchase text, provided by newgrf callback, if any.
+ * Otherwhise, will print Nothing */
+ if (_industrydata.additional_text[_industrydata.select] != STR_NULL &&
+ _industrydata.additional_text[_industrydata.select] != STR_UNDEFINED) {
+ SetDParam(0, _industrydata.additional_text[_industrydata.select]);
+ DrawStringMultiLine(x_str, y_str, STR_JUST_STRING, max_width, wi->bottom - wi->top - 40); // text is white, for now
+ }
+ } break;
-static const WindowDesc _build_industry_land0_desc = {
- WDP_AUTO, WDP_AUTO, 170, 116,
- WC_BUILD_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _build_industry_land0_widgets,
- BuildIndustryWndProc
-};
+ case WE_CLICK:
+ switch (e->we.click.widget) {
+ case DYNA_INDU_MATRIX_WIDGET: {
+ IndustryType type;
+ int y = (e->we.click.pt.y - w->widget[DYNA_INDU_MATRIX_WIDGET].top) / 13 + w->vscroll.pos ;
+
+ if (y >= 0 && y < _industrydata.count) { //Isit within the boundaries of available data?
+ _industrydata.select = y;
+ type = _industrydata.index[_industrydata.select];
+
+ SetWindowDirty(w);
+ if ((_game_mode != GM_EDITOR && _patches.raw_industry_construction == 2 && GetIndustrySpec(type)->IsRawIndustry()) ||
+ type == INVALID_INDUSTRYTYPE) {
+ /* Reset the button state if going to prospecting or "build many industries" */
+ RaiseWindowButtons(w);
+ ResetObjectToPlace();
+ }
+ }
+ } break;
+
+ case DYNA_INDU_FUND_WIDGET: {
+ IndustryType type = _industrydata.index[_industrydata.select];
+
+ if (type == INVALID_INDUSTRYTYPE) {
+ HandleButtonClick(w, DYNA_INDU_FUND_WIDGET);
+ WP(w, def_d).data_1 = -1;
+
+ if (GetNumTowns() == 0) {
+ ShowErrorMessage(STR_0286_MUST_BUILD_TOWN_FIRST, STR_CAN_T_GENERATE_INDUSTRIES, 0, 0);
+ } else {
+ extern void GenerateIndustries();
+ _generating_world = true;
+ GenerateIndustries();
+ _generating_world = false;
+ }
+ } else if (_game_mode != GM_EDITOR && _patches.raw_industry_construction == 2 && GetIndustrySpec(type)->IsRawIndustry()) {
+ DoCommandP(0, type, 0, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY));
+ HandleButtonClick(w, DYNA_INDU_FUND_WIDGET);
+ WP(w, def_d).data_1 = -1;
+ } else if (HandlePlacePushButton(w, DYNA_INDU_FUND_WIDGET, SPR_CURSOR_INDUSTRY, 1, NULL)) {
+ WP(w, def_d).data_1 = _industrydata.select;
+ }
+ }
+ break;
+ } break;
-static const WindowDesc _build_industry_land1_desc = {
- WDP_AUTO, WDP_AUTO, 170, 116,
- WC_BUILD_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _build_industry_land1_widgets,
- BuildIndustryWndProc
-};
+ case WE_RESIZE: {
+ w->vscroll.cap += e->we.sizing.diff.y / (int)w->resize.step_height;
+ w->widget[DYNA_INDU_MATRIX_WIDGET].data = (w->vscroll.cap << 8) + 1;
+ } break;
-static const WindowDesc _build_industry_land2_desc = {
- WDP_AUTO, WDP_AUTO, 170, 116,
- WC_BUILD_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _build_industry_land2_widgets,
- BuildIndustryWndProc
-};
+ case WE_PLACE_OBJ: {
+ IndustryType type = _industrydata.index[_industrydata.select];
-static const WindowDesc _build_industry_land3_desc = {
- WDP_AUTO, WDP_AUTO, 170, 116,
- WC_BUILD_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _build_industry_land3_widgets,
- BuildIndustryWndProc
-};
+ if (WP(w, def_d).data_1 == -1) break;
+ if (_game_mode == GM_EDITOR) {
+ /* Show error if no town exists at all */
+ if (GetNumTowns() == 0) {
+ SetDParam(0, GetIndustrySpec(type)->name);
+ ShowErrorMessage(STR_0286_MUST_BUILD_TOWN_FIRST, STR_0285_CAN_T_BUILD_HERE, e->we.place.pt.x, e->we.place.pt.y);
+ return;
+ }
-static const WindowDesc _build_industry_land0_desc_extra = {
- WDP_AUTO, WDP_AUTO, 170, 188,
- WC_BUILD_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _build_industry_land0_widgets_extra,
- BuildIndustryWndProc
-};
+ _current_player = OWNER_NONE;
+ _generating_world = true;
+ _ignore_restrictions = true;
+ if (!TryBuildIndustry(e->we.place.tile, type)) {
+ SetDParam(0, GetIndustrySpec(type)->name);
+ ShowErrorMessage(_error_message, STR_0285_CAN_T_BUILD_HERE, e->we.place.pt.x, e->we.place.pt.y);
+ } else {
+ ResetObjectToPlace();
+ }
+ _ignore_restrictions = false;
+ _generating_world = false;
+ } else if (DoCommandP(e->we.place.tile, type, 0, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY))) {
+ ResetObjectToPlace();
+ }
+ } break;
-static const WindowDesc _build_industry_land1_desc_extra = {
- WDP_AUTO, WDP_AUTO, 170, 175,
- WC_BUILD_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _build_industry_land1_widgets_extra,
- BuildIndustryWndProc
-};
+ case WE_ABORT_PLACE_OBJ:
+ RaiseWindowButtons(w);
+ break;
-static const WindowDesc _build_industry_land2_desc_extra = {
- WDP_AUTO, WDP_AUTO, 170, 201,
- WC_BUILD_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _build_industry_land2_widgets_extra,
- BuildIndustryWndProc
-};
+ case WE_TIMEOUT:
+ if (WP(w, def_d).data_1 == -1) {
+ RaiseWindowButtons(w);
+ WP(w, def_d).data_1 = 0;
+ }
+ break;
+ }
+}
-static const WindowDesc _build_industry_land3_desc_extra = {
- WDP_AUTO, WDP_AUTO, 170, 188,
- WC_BUILD_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _build_industry_land3_widgets_extra,
- BuildIndustryWndProc
+static const Widget _build_dynamic_industry_widgets[] = {
+{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
+{ WWT_CAPTION, RESIZE_RIGHT, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
+{ WWT_MATRIX, RESIZE_RB, 7, 0, 157, 14, 118, 0x801, STR_INDUSTRY_SELECTION_HINT},
+{ WWT_SCROLLBAR, RESIZE_LRB, 7, 158, 169, 14, 118, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
+{ WWT_PANEL, RESIZE_RTB, 7, 0, 169, 119, 199, 0x0, STR_NULL},
+{ WWT_TEXTBTN, RESIZE_RTB, 7, 0, 157, 200, 211, STR_FUND_NEW_INDUSTRY, STR_NULL},
+{ WWT_RESIZEBOX, RESIZE_LRTB, 7, 158, 169, 200, 211, 0x0, STR_RESIZE_BUTTON},
+{ WIDGETS_END},
};
-static const WindowDesc * const _industry_window_desc[2][4] = {
- {
- &_build_industry_land0_desc,
- &_build_industry_land1_desc,
- &_build_industry_land2_desc,
- &_build_industry_land3_desc,
- },
- {
- &_build_industry_land0_desc_extra,
- &_build_industry_land1_desc_extra,
- &_build_industry_land2_desc_extra,
- &_build_industry_land3_desc_extra,
- },
+static const WindowDesc _build_industry_dynamic_desc = {
+ WDP_AUTO, WDP_AUTO, 170, 212,
+ WC_BUILD_INDUSTRY, WC_NONE,
+ WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
+ _build_dynamic_industry_widgets,
+ BuildDynamicIndustryWndProc,
};
void ShowBuildIndustryWindow()
{
- if (!IsValidPlayer(_current_player)) return;
- AllocateWindowDescFront(_industry_window_desc[(_patches.raw_industry_construction == 0) ? 0 : 1][_opt_ptr->landscape], 0);
+ if (_game_mode != GM_EDITOR && !IsValidPlayer(_current_player)) return;
+ AllocateWindowDescFront(&_build_industry_dynamic_desc, 0);
}
+static void UpdateIndustryProduction(Industry *i);
+
static inline bool isProductionMinimum(const Industry *i, int pt) {
return i->production_rate[pt] == 1;
}
diff --git a/src/lang/american.txt b/src/lang/american.txt
index 2f613c27d..9cc948672 100644
--- a/src/lang/american.txt
+++ b/src/lang/american.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...there
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Are you sure you want to create a random landscape?
STR_MANY_RANDOM_TOWNS :{BLACK}Many random towns
STR_RANDOM_TOWNS_TIP :{BLACK}Cover the map with randomly placed towns
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Many random industries
+STR_MANY_RANDOM_INDUSTRIES :Many random industries
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Cover the map with randomly placed industries
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Can't generate industries...
diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt
index a57b6684f..a38b60955 100644
--- a/src/lang/brazilian_portuguese.txt
+++ b/src/lang/brazilian_portuguese.txt
@@ -1243,7 +1243,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...não
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Tem certeza que deseja criar um terreno aleatório?
STR_MANY_RANDOM_TOWNS :{BLACK}Várias cidades aleatórias
STR_RANDOM_TOWNS_TIP :{BLACK}Cobrir o mapa com cidades colocadas aleatoriamente
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Várias indústrias aleatórias
+STR_MANY_RANDOM_INDUSTRIES :Várias indústrias aleatórias
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Cobrir o mapa com indústrias colocadas aleatoriamente
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Impossível gerar indústrias...
diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt
index b33446960..a837a1f5c 100644
--- a/src/lang/bulgarian.txt
+++ b/src/lang/bulgarian.txt
@@ -1235,7 +1235,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...ня
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Потвърдете създаването на случаен терен?
STR_MANY_RANDOM_TOWNS :{BLACK}Много случайни градове
STR_RANDOM_TOWNS_TIP :{BLACK}Покриване на картата със случайно поставени градове
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Много случайни индустрии
+STR_MANY_RANDOM_INDUSTRIES :Много случайни индустрии
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Покриване на картата със случайно поставени индустрии
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Не може да се генерира промишленост...
diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt
index 92a19ec48..a76eea6b7 100644
--- a/src/lang/catalan.txt
+++ b/src/lang/catalan.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...no hi
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Estàs segur que vols crear un paisatge aleatori?
STR_MANY_RANDOM_TOWNS :{BLACK}Moltes poblacions aleatòries
STR_RANDOM_TOWNS_TIP :{BLACK}Omple el mapa amb poblacions situades aleatòriament
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Moltes indústries aleatòries
+STR_MANY_RANDOM_INDUSTRIES :Moltes indústries aleatòries
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Omple el mapa amb indústries situades aleatòriament
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}No es poden generar indústries...
diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt
index feec2247e..9d8d4bfd8 100644
--- a/src/lang/croatian.txt
+++ b/src/lang/croatian.txt
@@ -1236,7 +1236,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...u ovo
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Jeste li sigurni da želite napraviti nasumični krajolik?
STR_MANY_RANDOM_TOWNS :{BLACK}Mnogo nasumičnih gradova
STR_RANDOM_TOWNS_TIP :{BLACK}Popuni kartu nasumce smještenim gradovima
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Mnoge nasumične industrije
+STR_MANY_RANDOM_INDUSTRIES :Mnoge nasumične industrije
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Popuni kartu nasumce smještenim industrijama
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Ne možeš generirati gospodarstva...
diff --git a/src/lang/czech.txt b/src/lang/czech.txt
index defaa591a..1aac25e63 100644
--- a/src/lang/czech.txt
+++ b/src/lang/czech.txt
@@ -1299,7 +1299,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}... v to
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Opravdu chceš vytvořit nový náhodný terén?
STR_MANY_RANDOM_TOWNS :{BLACK}Hodně náhodných měst
STR_RANDOM_TOWNS_TIP :{BLACK}Pokryje krajinu mnoha náhodnými městy
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Hodně náhodného průmyslu
+STR_MANY_RANDOM_INDUSTRIES :Hodně náhodného průmyslu
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Pokryje krajinu náhodným průmyslem
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Nemůžu generovat průmysl...
diff --git a/src/lang/danish.txt b/src/lang/danish.txt
index b8b9c76bb..14518f3ca 100644
--- a/src/lang/danish.txt
+++ b/src/lang/danish.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...der e
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Er du sikker på, at du vil lave et tilfældigt landskab?
STR_MANY_RANDOM_TOWNS :{BLACK}Mange tilfældige byer
STR_RANDOM_TOWNS_TIP :{BLACK}Dæk kortet med tilfældigt placerede byer
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Mange tilfældige industrier
+STR_MANY_RANDOM_INDUSTRIES :Mange tilfældige industrier
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Dæk kortet med tilfældigt placerede industrier
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Kan ikke lave industrier...
diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt
index 063c7b4fc..789917f7f 100644
--- a/src/lang/dutch.txt
+++ b/src/lang/dutch.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...er is
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Weet je zeker dat je een willekeurig landschap wil maken?
STR_MANY_RANDOM_TOWNS :{BLACK}Veel willekeurige steden
STR_RANDOM_TOWNS_TIP :{BLACK}Bedek de kaart met willekeurig geplaatste steden
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Veel willekeurige industrieën
+STR_MANY_RANDOM_INDUSTRIES :Veel willekeurige industrieën
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Bedek de kaart met willekeurig geplaatste industrieën
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Kan geen industrieën genereren
diff --git a/src/lang/english.txt b/src/lang/english.txt
index d60aa428c..e11eac7cb 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...there
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Are you sure you want to create a random landscape?
STR_MANY_RANDOM_TOWNS :{BLACK}Many random towns
STR_RANDOM_TOWNS_TIP :{BLACK}Cover the map with randomly placed towns
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Many random industries
+STR_MANY_RANDOM_INDUSTRIES :Many random industries
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Cover the map with randomly placed industries
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Can't generate industries...
@@ -1980,8 +1980,12 @@ STR_4828_REQUIRES :{BLACK}Requires
STR_4829_REQUIRES :{BLACK}Requires: {YELLOW}{STRING}, {STRING}, {STRING}
############ range for requires ends
+############ range for produces starts
STR_INDUSTRY_WINDOW_WAITING_FOR_PROCESSING :{BLACK}Cargo waiting to be processed:
STR_INDUSTRY_WINDOW_WAITING_STOCKPILE_CARGO :{YELLOW}{CARGO}{BLACK}
+STR_4827_PRODUCES :{BLACK}Produces: {YELLOW}{STRING}
+STR_4828_PRODUCES :{BLACK}Produces: {YELLOW}{STRING}, {STRING}
+############ range for produces ends
STR_482A_PRODUCTION_LAST_MONTH :{BLACK}Production last month:
STR_482B_TRANSPORTED :{YELLOW}{CARGO}{BLACK} ({COMMA}% transported)
@@ -3372,3 +3376,8 @@ STR_NEXT_SIGN_TOOLTIP :{BLACK}Go to ne
STR_PREVIOUS_SIGN_TOOLTIP :{BLACK}Go to previous sign
########
+
+STR_FUND_NEW_INDUSTRY :{BLACK}Fund
+STR_PROSPECT_NEW_INDUSTRY :{BLACK}Prospect
+STR_BUILD_NEW_INDUSTRY :{BLACK}Build
+STR_INDUSTRY_SELECTION_HINT :{BLACK}Choose the appropriate industry from this list
diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt
index 91bbb3ffe..aad34a0d2 100644
--- a/src/lang/esperanto.txt
+++ b/src/lang/esperanto.txt
@@ -1224,7 +1224,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...manka
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Ĉu vi certas ke vi volas krei hazardan landaspekton?
STR_MANY_RANDOM_TOWNS :{BLACK}Multaj hazardaj urboj
STR_RANDOM_TOWNS_TIP :{BLACK}Kovru la mapon per hazarde metitajn urbojn
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Multaj hazardaj industrioj
+STR_MANY_RANDOM_INDUSTRIES :Multaj hazardaj industrioj
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Kovru la mapon per hazarde metitajn industriojn
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Ne povas generi industriojn...
diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt
index 583d8028e..1e8e83246 100644
--- a/src/lang/estonian.txt
+++ b/src/lang/estonian.txt
@@ -1341,7 +1341,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...kaard
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Oled sa kindel, et soovid luua suvalist maastikku?
STR_MANY_RANDOM_TOWNS :{BLACK}Palju suvalisi linnu
STR_RANDOM_TOWNS_TIP :{BLACK}Kaardi katmine suvaliselt asetatud linnadega
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Palju suvalisi tööstusi
+STR_MANY_RANDOM_INDUSTRIES :Palju suvalisi tööstusi
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Kata kaart suvaliselt paigutatud tööstustega
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Tööstust ei saa tekitada...
diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt
index dfa8e4e79..0822c1187 100644
--- a/src/lang/finnish.txt
+++ b/src/lang/finnish.txt
@@ -1221,7 +1221,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...täss
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Haluatko todella luoda satunnaisen maaston?
STR_MANY_RANDOM_TOWNS :{BLACK}Monta satunnaista kaupunkia
STR_RANDOM_TOWNS_TIP :{BLACK}Peitä kartta satunnaisesti sijoitetuilla kaupungeilla.
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Monta satunnaista teollisuusaluetta
+STR_MANY_RANDOM_INDUSTRIES :Monta satunnaista teollisuusaluetta
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Peitä kartta satunnaisesti sijoitetuilla teollisuusalueilla.
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Teollisuusaluetta ei voi luoda...
diff --git a/src/lang/french.txt b/src/lang/french.txt
index 1a4d924da..290212e43 100644
--- a/src/lang/french.txt
+++ b/src/lang/french.txt
@@ -1242,7 +1242,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...il n'
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Etes-vous sûr de vouloir créer un terrain aléatoire?
STR_MANY_RANDOM_TOWNS :{BLACK}Beaucoup de villes au hasard
STR_RANDOM_TOWNS_TIP :{BLACK}Couvrir la carte avec des villes placées aléatoirement
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Beaucoup d'industries au hasard
+STR_MANY_RANDOM_INDUSTRIES :Beaucoup d'industries au hasard
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Couvrir la carte avec des industries placées au hasard
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Ne peut pas générer les industries...
diff --git a/src/lang/galician.txt b/src/lang/galician.txt
index 6a2e71841..f2b657e1d 100644
--- a/src/lang/galician.txt
+++ b/src/lang/galician.txt
@@ -1148,7 +1148,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...non h
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}¿Estás seguro de querer crear unha paisaxe aleatoria?
STR_MANY_RANDOM_TOWNS :{BLACK}Varias cidades aleatorias
STR_RANDOM_TOWNS_TIP :{BLACK}Cubri-lo mapa con cidades colocadas aleatoriamente
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Varias industrias aleatorias
+STR_MANY_RANDOM_INDUSTRIES :Varias industrias aleatorias
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Cubri-lo mapa con industrias colocadas aleatoriamente
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Non se poden xera-las industrias...
diff --git a/src/lang/german.txt b/src/lang/german.txt
index cfc23dacb..2af98d4b3 100644
--- a/src/lang/german.txt
+++ b/src/lang/german.txt
@@ -1237,7 +1237,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...in di
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Soll wirklich eine zufällige Landschaft erzeugt werden?
STR_MANY_RANDOM_TOWNS :{BLACK}Viele zufällige Städte
STR_RANDOM_TOWNS_TIP :{BLACK}Bedecke die Karte mit zufällig platzierten Städten
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Viele zufällige Industrien
+STR_MANY_RANDOM_INDUSTRIES :Viele zufällige Industrien
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Bedecke die Karte mit zufällig platzierten Industrien
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Kann keine Industrie erzeugen...
diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt
index 7ae9e4413..e3d5c59d0 100644
--- a/src/lang/hungarian.txt
+++ b/src/lang/hungarian.txt
@@ -1307,7 +1307,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...nincs
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Biztos vagy benne hogy véletlen tájképet akarsz létrehozni?
STR_MANY_RANDOM_TOWNS :{BLACK}Sok véletlen város
STR_RANDOM_TOWNS_TIP :{BLACK}Elhelyez a térképen véletlenszerüen sok várost.
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Sok véletlen gazdasági épület
+STR_MANY_RANDOM_INDUSTRIES :Sok véletlen gazdasági épület
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Elhelyez a térképen véletlenszerüen sok gazdasági épületet
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Nem tudok gazdasági épületet generálni...
diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt
index 564c20ba3..b7a30b67d 100644
--- a/src/lang/icelandic.txt
+++ b/src/lang/icelandic.txt
@@ -1192,7 +1192,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...það
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Ertu viss um að þú viljir búa til handahófskennt land?
STR_MANY_RANDOM_TOWNS :{BLACK}Búa til marga bæi
STR_RANDOM_TOWNS_TIP :{BLACK}Þekja landið með bæjum
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Búa til marga iðnaði
+STR_MANY_RANDOM_INDUSTRIES :Búa til marga iðnaði
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Þekja kortið mörgum handahófskenndum iðnöðum
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Get ekki búið til iðnað...
diff --git a/src/lang/italian.txt b/src/lang/italian.txt
index dd0d64221..86cc6ecb2 100644
--- a/src/lang/italian.txt
+++ b/src/lang/italian.txt
@@ -1243,7 +1243,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...non c
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Si è sicuri di voler generare un paesaggio casuale?
STR_MANY_RANDOM_TOWNS :{BLACK}Alcune città casuali
STR_RANDOM_TOWNS_TIP :{BLACK}Copre la mappa con città posizionate casualmente
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Alcune industrie casuali
+STR_MANY_RANDOM_INDUSTRIES :Alcune industrie casuali
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Copre la mappa con industrie posizionate casualmente
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Impossibile generare industrie...
diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt
index c4e42dd28..ed7fcf27b 100644
--- a/src/lang/japanese.txt
+++ b/src/lang/japanese.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...こ
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}ランダムな地形を作成してもよろしいですか?
STR_MANY_RANDOM_TOWNS :{BLACK}多くのランダムな市町村
STR_RANDOM_TOWNS_TIP :{BLACK}地図にたくさんの市町村を建設します
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}多くのランダムな産業
+STR_MANY_RANDOM_INDUSTRIES :多くのランダムな産業
STR_RANDOM_INDUSTRIES_TIP :{BLACK}地図にたくさんの産業を建設します
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}産業が建設できません...
diff --git a/src/lang/korean.txt b/src/lang/korean.txt
index 316d8fd5b..8f194267a 100644
--- a/src/lang/korean.txt
+++ b/src/lang/korean.txt
@@ -1242,7 +1242,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...시
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}무작위로 지형을 생성하시겠습니까?
STR_MANY_RANDOM_TOWNS :{BLACK}무작위 도시 건설
STR_RANDOM_TOWNS_TIP :{BLACK}무작위로 도시를 건설합니다.
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}무작위 산업시설 건설
+STR_MANY_RANDOM_INDUSTRIES :무작위 산업시설 건설
STR_RANDOM_INDUSTRIES_TIP :{BLACK}무작위로 산업시설을 건설합니다.
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}산업시설을 생성할 수 없습니다...
diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt
index 11d130bd9..78eaab476 100644
--- a/src/lang/lithuanian.txt
+++ b/src/lang/lithuanian.txt
@@ -1224,7 +1224,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...siame
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Ar tikrai norite sukurti atsitiktinį kraštovaizdį?
STR_MANY_RANDOM_TOWNS :{BLACK}Daug atsitiktinių miestų
STR_RANDOM_TOWNS_TIP :{BLACK}Sukuria miestus atsitiktinėse žemėlapio vietose
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Daug atsitiktinių pramonės įmonių
+STR_MANY_RANDOM_INDUSTRIES :Daug atsitiktinių pramonės įmonių
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Sukuria pramonės įmones atsitiktinėse žemėlapio vietose
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Neimanoma sukurti pramones imoniu...
diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt
index 2b149167b..9b8032baf 100644
--- a/src/lang/norwegian_bokmal.txt
+++ b/src/lang/norwegian_bokmal.txt
@@ -1222,7 +1222,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...det e
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Er du sikker på at du vil lage et tilfeldig generert landskap?
STR_MANY_RANDOM_TOWNS :{BLACK}Mange tilfeldige byer
STR_RANDOM_TOWNS_TIP :{BLACK}Dekk kartet med tilfeldig plasserte byer
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Mange tilfeldige industrier
+STR_MANY_RANDOM_INDUSTRIES :Mange tilfeldige industrier
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Dekk kartet med tilfeldig plasserte industrier
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Kan ikke generere industrier...
diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt
index 707ef7d5a..8a3b6116d 100644
--- a/src/lang/norwegian_nynorsk.txt
+++ b/src/lang/norwegian_nynorsk.txt
@@ -1238,7 +1238,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...det e
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Er du sikker på at du vil lage eit tilfeldig generert landskap?
STR_MANY_RANDOM_TOWNS :{BLACK}Mange tilfeldige byar
STR_RANDOM_TOWNS_TIP :{BLACK}Dekk kartet med tilfeldig plasserte byar
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Mange tilfeldige industriar
+STR_MANY_RANDOM_INDUSTRIES :Mange tilfeldige industriar
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Dekk kartet med tilfeldig plasserte industriar
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Kan ikkje lage industriar...
diff --git a/src/lang/piglatin.txt b/src/lang/piglatin.txt
index 1230fb8b7..ab6450f72 100644
--- a/src/lang/piglatin.txt
+++ b/src/lang/piglatin.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...ereth
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Areway ouyay uresay ouyay antway otay eatecray away andomray andscapelay?
STR_MANY_RANDOM_TOWNS :{BLACK}Anymay andomray ownstay
STR_RANDOM_TOWNS_TIP :{BLACK}Overcay ethay apmay ithway andomlyray acedplay ownstay
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Anymay andomray industriesway
+STR_MANY_RANDOM_INDUSTRIES :Anymay andomray industriesway
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Overcay ethay apmay ithway andomlyray acedplay industriesway
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}An'tcay enerategay industriesway...
diff --git a/src/lang/polish.txt b/src/lang/polish.txt
index e8c7c1773..b6c9412f4 100644
--- a/src/lang/polish.txt
+++ b/src/lang/polish.txt
@@ -1324,7 +1324,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...nie m
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Jesteś pewien że chcesz stworzyć losowy krajobraz?
STR_MANY_RANDOM_TOWNS :{BLACK}Wiele losowych miast
STR_RANDOM_TOWNS_TIP :{BLACK}Pokryj mapę losowo położonymi miastami
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Wiele losowych przedsiębiorstw
+STR_MANY_RANDOM_INDUSTRIES :Wiele losowych przedsiębiorstw
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Pokryj mapę losowo położonymi przedsiębiorstwami
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Nie można stworzyć przedsiębiorstw...
diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt
index 6db4571cd..5e8f8523c 100644
--- a/src/lang/portuguese.txt
+++ b/src/lang/portuguese.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...não
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Tem a certeza que deseja criar um terreno aleatório?
STR_MANY_RANDOM_TOWNS :{BLACK}Várias cidades aleatórias
STR_RANDOM_TOWNS_TIP :{BLACK}Cobrir o mapa com cidades colocadas aleatoriamente
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Várias indústrias aleatórias
+STR_MANY_RANDOM_INDUSTRIES :Várias indústrias aleatórias
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Cobrir o mapa com indústrias colocadas aleatoriamente
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Não é possível gerar indústrias...
diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt
index fd71bb385..ea1869e39 100644
--- a/src/lang/romanian.txt
+++ b/src/lang/romanian.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...în a
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Esti sigur cã vrei sã creezi un peisaj aleator?
STR_MANY_RANDOM_TOWNS :{BLACK}Mai multe orase aleatoare
STR_RANDOM_TOWNS_TIP :{BLACK}Umple harta cu orase generate aleator
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Multe industrii aleatoare
+STR_MANY_RANDOM_INDUSTRIES :Multe industrii aleatoare
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Umple harta cu industrii generate aleator
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Nu pot genera industrii...
diff --git a/src/lang/russian.txt b/src/lang/russian.txt
index 49c0a248a..10002d723 100644
--- a/src/lang/russian.txt
+++ b/src/lang/russian.txt
@@ -1243,7 +1243,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...в э
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Вы уверены, что хотите создать случайную землю?
STR_MANY_RANDOM_TOWNS :{BLACK}Много случайных городов
STR_RANDOM_TOWNS_TIP :{BLACK}Случайно разместить на карте города
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Много произвольных промышленностей
+STR_MANY_RANDOM_INDUSTRIES :Много произвольных промышленностей
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Случайно разместить предприятия на карте
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Невозможно создать промышленность...
diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt
index 4b706c022..6c87b97d9 100644
--- a/src/lang/simplified_chinese.txt
+++ b/src/lang/simplified_chinese.txt
@@ -1214,7 +1214,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}当前
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}你确定要创建一个随机的景观吗?
STR_MANY_RANDOM_TOWNS :{BLACK}大量随机城镇
STR_RANDOM_TOWNS_TIP :{BLACK}在地图上创建大量随机的城镇
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}大量随机工业
+STR_MANY_RANDOM_INDUSTRIES :大量随机工业
STR_RANDOM_INDUSTRIES_TIP :{BLACK}在地图上创建大量随机的工业设施
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}不能生成工业设施……
diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt
index 89434cb8a..b236cf733 100644
--- a/src/lang/slovak.txt
+++ b/src/lang/slovak.txt
@@ -1305,7 +1305,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}... v to
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Si si isty, ze chces vytvorit nahodny teren?
STR_MANY_RANDOM_TOWNS :{BLACK}Vela nahodnych miest
STR_RANDOM_TOWNS_TIP :{BLACK}Pokryt mapu nahodne umiestnenymi mestami
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Vela nahodneho priemyslu
+STR_MANY_RANDOM_INDUSTRIES :Vela nahodneho priemyslu
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Pokryt mapu nahodne umiestnenym priemyslom
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Nemozno vygenerovat priemysel ...
diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt
index 901617314..d43a5c408 100644
--- a/src/lang/slovenian.txt
+++ b/src/lang/slovenian.txt
@@ -1283,7 +1283,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...ni me
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Zagotovo želiš ustvariti naključno zemljišče?
STR_MANY_RANDOM_TOWNS :{BLACK}Več naključnih mest
STR_RANDOM_TOWNS_TIP :{BLACK}Postavi na ozemlje naključna mesta
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Več naključnih industrij
+STR_MANY_RANDOM_INDUSTRIES :Več naključnih industrij
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Postavi na ozemlje naključno industrijo
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Ni mogoče zgraditi industrij ...
diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt
index 5142d83e7..1a8493040 100644
--- a/src/lang/spanish.txt
+++ b/src/lang/spanish.txt
@@ -1242,7 +1242,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...no ha
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}¿Está seguro de generar un paisaje al azar?
STR_MANY_RANDOM_TOWNS :{BLACK}Varias poblaciones al azar
STR_RANDOM_TOWNS_TIP :{BLACK}Cubre el mapa con poblaciones colocadas al azar
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Varias industrias al azar
+STR_MANY_RANDOM_INDUSTRIES :Varias industrias al azar
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Cubre el mapa con industrias colocadas al azar
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}No se pueden crear industrias...
diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt
index 0a864d8c0..109d14b0a 100644
--- a/src/lang/swedish.txt
+++ b/src/lang/swedish.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...det f
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Är du säker på att du vill generera ett slumpmässigt landskap?
STR_MANY_RANDOM_TOWNS :{BLACK}Många slumpmässiga städer
STR_RANDOM_TOWNS_TIP :{BLACK}Täck kartan med slumpmässigt placerade städer
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Många slumpmässiga industrier
+STR_MANY_RANDOM_INDUSTRIES :Många slumpmässiga industrier
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Täck kartan med slumpmässigt placerade industrier
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Kan inte generera industrier...
diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt
index 47b7db0f4..fdfb015d5 100644
--- a/src/lang/traditional_chinese.txt
+++ b/src/lang/traditional_chinese.txt
@@ -1241,7 +1241,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...這
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}你要建立一個隨機地形嗎?
STR_MANY_RANDOM_TOWNS :{BLACK}隨機產生多個市鎮
STR_RANDOM_TOWNS_TIP :{BLACK}以隨機放置的市鎮佈滿版圖
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}隨機產生多個工業
+STR_MANY_RANDOM_INDUSTRIES :隨機產生多個工業
STR_RANDOM_INDUSTRIES_TIP :{BLACK}以隨機放置的工業佈滿版圖
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}隨機產生工業失敗...
diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt
index 2f44b5521..6f745cafb 100644
--- a/src/lang/turkish.txt
+++ b/src/lang/turkish.txt
@@ -1232,7 +1232,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...Bu se
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Arazinin rasgele düzenlenmesini istediğinizden emin misiniz?
STR_MANY_RANDOM_TOWNS :{BLACK}Birçok rastgele şehir
STR_RANDOM_TOWNS_TIP :{BLACK}Haritayı rastgele şehirlerle doldur
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Birçok rastgele fabrika
+STR_MANY_RANDOM_INDUSTRIES :Birçok rastgele fabrika
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Haritayı rastgele fabrikalarla doldur
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Fabrika yapılamıyor...
diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt
index beea50651..384214eb0 100644
--- a/src/lang/ukrainian.txt
+++ b/src/lang/ukrainian.txt
@@ -1367,7 +1367,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...у ц
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Ви дійсно бажаєте створити ландшафт випадково?
STR_MANY_RANDOM_TOWNS :{BLACK}Багато різних міст
STR_RANDOM_TOWNS_TIP :{BLACK}Випадково розташувати міста по карті
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Багато різної промисловості
+STR_MANY_RANDOM_INDUSTRIES :Багато різної промисловості
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Випадково розташувати промисловість по карті
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Неможливо створити промисловість...
diff --git a/src/lang/unfinished/afrikaans.txt b/src/lang/unfinished/afrikaans.txt
index 9b094c9fa..840d1f04b 100644
--- a/src/lang/unfinished/afrikaans.txt
+++ b/src/lang/unfinished/afrikaans.txt
@@ -1124,7 +1124,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...daar
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Is jy seker jy wil 'n lukraake landeryke skep?
STR_MANY_RANDOM_TOWNS :{BLACK}Baie lukraak stede
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Baie luraak nyweheide
+STR_MANY_RANDOM_INDUSTRIES :Baie luraak nyweheide
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Kan nie nywerheide ontwikkel nie...
STR_LANDSCAPING_TOOLBAR_TIP :{BLACK}Oppe die landargitekteur werktuigbaan om land te verhoog/verlaag, boome beplant, ens.
diff --git a/src/lang/unfinished/greek.txt b/src/lang/unfinished/greek.txt
index 58e356188..e7c80784c 100644
--- a/src/lang/unfinished/greek.txt
+++ b/src/lang/unfinished/greek.txt
@@ -1198,7 +1198,7 @@ STR_NO_TOWN_IN_SCENARIO :{WHITE}...δε
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Είστε σίγουρος ότι θέλετε να δημιουργήσετε ένα τυχαίο τοπίο;
STR_MANY_RANDOM_TOWNS :{BLACK}Πολλές τυχαίες πόλεις
STR_RANDOM_TOWNS_TIP :{BLACK}Κάλυψη του χάρτη με τυχαία τοποθετημένες πόλεις
-STR_MANY_RANDOM_INDUSTRIES :{BLACK}Πολλές τυχαίες βιομηχανίες
+STR_MANY_RANDOM_INDUSTRIES :Πολλές τυχαίες βιομηχανίες
@@ -2017,3 +2017,4 @@ SET_PERFORMANCE_DETAIL_INT :{BLACK}{NUM}.
########
+
diff --git a/src/lang/unfinished/latvian.txt b/src/lang/unfinished/latvian.txt
index 3b0b7df66..48d877e3d 100644
--- a/src/lang/unfinished/latvian.txt
+++ b/src/lang/unfinished/latvian.txt
@@ -1166,7 +1166,7 @@ STR_BUILD_AUTORAIL_TIP :{BLACK}Būvē d
STR_NO_TOWN_IN_SCENARIO :{WHITE}...šajā scenārijā nav pilsētu
STR_GENERATE_RANDOM_LANDSCAPE :{WHITE}Vai jūs esat pārliecināts, ka vēlaties izveidot nejauši izvēlētu ainavu?
-STR_MANY_RANDOM_TOWNS :{BLACK}Daudz nejauši izveidotu pilsētu
+STR_MANY_RANDOM_TOWNS :Daudz nejauši izveidotu pilsētu
STR_RANDOM_TOWNS_TIP :{BLACK}Pāklāt karti ar nejauši izvietotām pilsētām
STR_MANY_RANDOM_INDUSTRIES :{BLACK}Daudz nejauši izveidotu rūpniecību
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Pāklāt karti ar nejauši izvietotām rūpniecībām
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 22ecde8b7..645329c72 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -1540,247 +1540,11 @@ static void ToolbarScenGenTown(Window *w)
AllocateWindowDescFront(&_scen_edit_town_gen_desc, 0);
}
-
-static const Widget _scenedit_industry_normal_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 224, 0x0, STR_NULL},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0240_COAL_MINE, STR_0262_CONSTRUCT_COAL_MINE},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 81, 92, STR_0243_FOREST, STR_0265_PLANT_FOREST},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 94, 105, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 107, 118, STR_0245_OIL_RIG, STR_0267_CONSTRUCT_OIL_RIG_CAN_ONLY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 120, 131, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 133, 144, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 146, 157, STR_0248_FARM, STR_026A_CONSTRUCT_FARM},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 159, 170, STR_0249_IRON_ORE_MINE, STR_026B_CONSTRUCT_IRON_ORE_MINE},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 172, 183, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 185, 196, STR_024B_BANK, STR_026D_CONSTRUCT_BANK_CAN_ONLY},
-{ WIDGETS_END},
-};
-
-
-static const Widget _scenedit_industry_hilly_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 224, 0x0, STR_NULL},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0240_COAL_MINE, STR_0262_CONSTRUCT_COAL_MINE},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 81, 92, STR_0243_FOREST, STR_0265_PLANT_FOREST},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 94, 105, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 107, 118, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 120, 131, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 133, 144, STR_024F_GOLD_MINE, STR_0271_CONSTRUCT_GOLD_MINE},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 146, 157, STR_0248_FARM, STR_026A_CONSTRUCT_FARM},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 159, 170, STR_024B_BANK, STR_0272_CONSTRUCT_BANK_CAN_ONLY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 172, 183, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS},
-{ WIDGETS_END},
-};
-
-static const Widget _scenedit_industry_desert_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 224, 0x0, STR_NULL},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0251_FRUIT_PLANTATION, STR_0274_PLANT_FRUIT_PLANTATION},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0252_RUBBER_PLANTATION, STR_0275_PLANT_RUBBER_PLANTATION},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 81, 92, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 94, 105, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 107, 118, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 120, 131, STR_0253_WATER_SUPPLY, STR_0276_CONSTRUCT_WATER_SUPPLY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 133, 144, STR_0248_FARM, STR_026A_CONSTRUCT_FARM},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 146, 157, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 159, 170, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 172, 183, STR_024B_BANK, STR_0272_CONSTRUCT_BANK_CAN_ONLY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 185, 196, STR_0255_DIAMOND_MINE, STR_0278_CONSTRUCT_DIAMOND_MINE},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 198, 209, STR_0256_COPPER_ORE_MINE, STR_0279_CONSTRUCT_COPPER_ORE_MINE},
-{ WIDGETS_END},
-};
-
-static const Widget _scenedit_industry_candy_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL},
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 224, 0x0, STR_NULL},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP},
-
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0257_COTTON_CANDY_FOREST, STR_027A_PLANT_COTTON_CANDY_FOREST},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0259_BATTERY_FARM, STR_027C_CONSTRUCT_BATTERY_FARM},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 81, 92, STR_025A_COLA_WELLS, STR_027D_CONSTRUCT_COLA_WELLS},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 94, 105, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 107, 118, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 120, 131, STR_025D_PLASTIC_FOUNTAINS, STR_0280_CONSTRUCT_PLASTIC_FOUNTAINS},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 133, 144, STR_025E_FIZZY_DRINK_FACTORY, STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 146, 157, STR_025F_BUBBLE_GENERATOR, STR_0282_CONSTRUCT_BUBBLE_GENERATOR},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 159, 170, STR_0260_TOFFEE_QUARRY, STR_0283_CONSTRUCT_TOFFEE_QUARRY},
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 172, 183, STR_0261_SUGAR_MINE, STR_0284_CONSTRUCT_SUGAR_MINE},
-{ WIDGETS_END},
-};
-
-
-static bool AnyTownExists()
-{
- const Town *t;
-
- FOR_ALL_TOWNS(t) return true;
-
- return false;
-}
-
-extern Industry *CreateNewIndustry(TileIndex tile, IndustryType type);
-
-/**
- * Search callback function for TryBuildIndustry
- * @param tile to test
- * @param data that is passed by the caller. In this case, the type of industry been tested
- * @return the success (or not) of the operation
- */
-static bool SearchTileForIndustry(TileIndex tile, uint32 data)
-{
- return CreateNewIndustry(tile, data) != NULL;
-}
-
-/**
- * Perform a 9*9 tiles circular search around a tile
- * in order to find a suitable zone to create the desired industry
- * @param tile to start search for
- * @param type of the desired industry
- * @return the success (or not) of the operation
- */
-static bool TryBuildIndustry(TileIndex tile, int type)
-{
- return CircularTileSearch(tile, 9, SearchTileForIndustry, type);
-}
-
-
-static const byte _industry_type_list[4][16] = {
- { 0, 1, 2, 3, 4, 5, 6, 8, 9, 18, 11, 12},
- { 0, 1, 14, 3, 4, 13, 7, 15, 9, 16, 11, 12},
- {25, 19, 20, 4, 13, 23, 21, 24, 22, 11, 16, 17, 10},
- {26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36},
-};
-
-static int _industry_type_to_place;
-bool _ignore_restrictions;
-
-static void ScenEditIndustryWndProc(Window *w, WindowEvent *e)
-{
- int button;
-
- switch (e->event) {
- case WE_PAINT:
- DrawWindowWidgets(w);
- break;
-
- case WE_CLICK:
- if (e->we.click.widget == 3) {
- HandleButtonClick(w, 3);
-
- if (!AnyTownExists()) {
- ShowErrorMessage(STR_0286_MUST_BUILD_TOWN_FIRST, STR_CAN_T_GENERATE_INDUSTRIES, 0, 0);
- return;
- }
-
- _generating_world = true;
- GenerateIndustries();
- _generating_world = false;
- }
-
- if ((button=e->we.click.widget) >= 4) {
- if (HandlePlacePushButton(w, button, SPR_CURSOR_INDUSTRY, 1, NULL))
- _industry_type_to_place = _industry_type_list[_opt.landscape][button - 4];
- }
- break;
- case WE_PLACE_OBJ: {
- int type;
-
- /* Show error if no town exists at all */
- type = _industry_type_to_place;
- if (!AnyTownExists()) {
- SetDParam(0, GetIndustrySpec(type)->name);
- ShowErrorMessage(STR_0286_MUST_BUILD_TOWN_FIRST, STR_0285_CAN_T_BUILD_HERE, e->we.place.pt.x, e->we.place.pt.y);
- return;
- }
-
- _current_player = OWNER_NONE;
- _generating_world = true;
- _ignore_restrictions = true;
- if (!TryBuildIndustry(e->we.place.tile,type)) {
- SetDParam(0, GetIndustrySpec(type)->name);
- ShowErrorMessage(_error_message, STR_0285_CAN_T_BUILD_HERE, e->we.place.pt.x, e->we.place.pt.y);
- }
- _ignore_restrictions = false;
- _generating_world = false;
- break;
- }
- case WE_ABORT_PLACE_OBJ:
- RaiseWindowButtons(w);
- SetWindowDirty(w);
- break;
- case WE_TIMEOUT:
- RaiseWindowWidget(w, 3);
- InvalidateWidget(w, 3);
- break;
- }
-}
-
-static const WindowDesc _scenedit_industry_normal_desc = {
- WDP_AUTO, WDP_AUTO, 170, 225,
- WC_SCEN_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _scenedit_industry_normal_widgets,
- ScenEditIndustryWndProc,
-};
-
-static const WindowDesc _scenedit_industry_hilly_desc = {
- WDP_AUTO, WDP_AUTO, 170, 225,
- WC_SCEN_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _scenedit_industry_hilly_widgets,
- ScenEditIndustryWndProc,
-};
-
-static const WindowDesc _scenedit_industry_desert_desc = {
- WDP_AUTO, WDP_AUTO, 170, 225,
- WC_SCEN_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _scenedit_industry_desert_widgets,
- ScenEditIndustryWndProc,
-};
-
-static const WindowDesc _scenedit_industry_candy_desc = {
- WDP_AUTO, WDP_AUTO, 170, 225,
- WC_SCEN_INDUSTRY, WC_NONE,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
- _scenedit_industry_candy_widgets,
- ScenEditIndustryWndProc,
-};
-
-static const WindowDesc * const _scenedit_industry_descs[] = {
- &_scenedit_industry_normal_desc,
- &_scenedit_industry_hilly_desc,
- &_scenedit_industry_desert_desc,
- &_scenedit_industry_candy_desc,
-};
-
-
static void ToolbarScenGenIndustry(Window *w)
{
HandleButtonClick(w, 13);
SndPlayFx(SND_15_BEEP);
- AllocateWindowDescFront(_scenedit_industry_descs[_opt.landscape],0);
+ ShowBuildIndustryWindow();
}
static void ToolbarScenBuildRoad(Window *w)