diff options
author | frosch <frosch@openttd.org> | 2014-04-27 15:15:28 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2014-04-27 15:15:28 +0000 |
commit | 775c96a0d27fe1d20a0c75c7dc6dbaa514f032fd (patch) | |
tree | 0dc29abfaec706894101e6b5f736840016bbdb53 | |
parent | ebd2d3ccef7babead511b133d78654ea2ca38343 (diff) | |
download | openttd-775c96a0d27fe1d20a0c75c7dc6dbaa514f032fd.tar.xz |
(svn r26526) -Remove: Ability to set map generation seed via GUI. If you really need it, use the console.
-rw-r--r-- | src/genworld_gui.cpp | 41 | ||||
-rw-r--r-- | src/lang/english.txt | 4 | ||||
-rw-r--r-- | src/script/api/game/game_window.hpp.sq | 2 | ||||
-rw-r--r-- | src/script/api/script_window.hpp | 3 | ||||
-rw-r--r-- | src/widgets/genworld_widget.h | 3 |
5 files changed, 5 insertions, 48 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 9a2fe62b5..a95a32630 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -84,7 +84,6 @@ static const NWidgetPart _nested_generate_landscape_widgets[] = { NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_LAND_GENERATOR, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_NUMBER_OF_TOWNS, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_TERRAIN_TYPE, STR_NULL), SetFill(1, 1), - NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_RANDOM_SEED, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_QUANTITY_OF_SEA_LAKES, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_TREE_PLACER, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_VARIETY, STR_NULL), SetFill(1, 1), @@ -101,7 +100,6 @@ static const NWidgetPart _nested_generate_landscape_widgets[] = { NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_LANDSCAPE_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TOWN_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TERRAIN_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), - NWidget(WWT_EDITBOX, COLOUR_ORANGE, WID_GL_RANDOM_EDITBOX), SetDataTip(STR_MAPGEN_RANDOM_SEED_OSKTITLE, STR_MAPGEN_RANDOM_SEED_HELP), SetFill(1, 1), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_WATER_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TREE_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_VARIETY_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), @@ -115,6 +113,7 @@ static const NWidgetPart _nested_generate_landscape_widgets[] = { NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_SNOW_LINE_HEIGHT, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_NUMBER_OF_INDUSTRIES, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_SMOOTHNESS, STR_NULL), SetFill(1, 1), + NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_QUANTITY_OF_RIVERS, STR_NULL), SetFill(1, 1), EndContainer(), NWidget(NWID_VERTICAL, NC_EQUALSIZE), SetPIP(0, 4, 0), /* Starting date. */ @@ -131,13 +130,9 @@ static const NWidgetPart _nested_generate_landscape_widgets[] = { EndContainer(), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_INDUSTRY_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_SMOOTHNESS_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), + NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_RIVER_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), EndContainer(), EndContainer(), - NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, WID_GL_RANDOM_BUTTON), SetDataTip(STR_MAPGEN_RANDOM, STR_MAPGEN_RANDOM_HELP), SetFill(1, 0), - NWidget(NWID_HORIZONTAL), SetPIP(0, 3, 0), - NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_QUANTITY_OF_RIVERS, STR_NULL), SetFill(1, 1), - NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_RIVER_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), - EndContainer(), NWidget(NWID_SPACER), SetFill(1, 1), NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_GL_GENERATE_BUTTON), SetMinimalSize(84, 30), SetDataTip(STR_MAPGEN_GENERATE, STR_NULL), SetFill(1, 0), EndContainer(), @@ -201,7 +196,6 @@ static const NWidgetPart _nested_heightmap_load_widgets[] = { NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_MAPSIZE, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_NUMBER_OF_TOWNS, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_NUMBER_OF_INDUSTRIES, STR_NULL), SetFill(1, 1), - NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_RANDOM_SEED, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_QUANTITY_OF_RIVERS, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_TREE_PLACER, STR_NULL), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_HEIGHTMAP_ROTATION, STR_NULL), SetFill(1, 1), @@ -219,7 +213,6 @@ static const NWidgetPart _nested_heightmap_load_widgets[] = { EndContainer(), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TOWN_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_INDUSTRY_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), - NWidget(WWT_EDITBOX, COLOUR_ORANGE, WID_GL_RANDOM_EDITBOX), SetDataTip(STR_MAPGEN_RANDOM_SEED_OSKTITLE, STR_MAPGEN_RANDOM_SEED_HELP), SetFill(1, 1), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_RIVER_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TREE_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_HEIGHTMAP_ROTATION_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0), @@ -245,7 +238,6 @@ static const NWidgetPart _nested_heightmap_load_widgets[] = { EndContainer(), EndContainer(), EndContainer(), - NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, WID_GL_RANDOM_BUTTON), SetDataTip(STR_MAPGEN_RANDOM, STR_MAPGEN_RANDOM_HELP), SetFill(1, 0), NWidget(NWID_SPACER), SetFill(1, 1), NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_GL_GENERATE_BUTTON), SetMinimalSize(84, 30), SetDataTip(STR_MAPGEN_GENERATE, STR_NULL), SetFill(1, 0), EndContainer(), @@ -311,19 +303,13 @@ struct GenerateLandscapeWindow : public Window { uint y; char name[64]; GenenerateLandscapeWindowMode mode; - QueryString seed_editbox; - GenerateLandscapeWindow(WindowDesc *desc, WindowNumber number = 0) : Window(desc), seed_editbox(11) + GenerateLandscapeWindow(WindowDesc *desc, WindowNumber number = 0) : Window(desc) { this->InitNested(number); this->LowerWidget(_settings_newgame.game_creation.landscape + WID_GL_TEMPERATE); - this->querystrings[WID_GL_RANDOM_EDITBOX] = &this->seed_editbox; - this->seed_editbox.text.Print("%u", _settings_newgame.game_creation.generation_seed); - this->seed_editbox.caption = STR_NULL; - this->seed_editbox.text.afilter = CS_NUMERAL; - this->mode = (GenenerateLandscapeWindowMode)this->window_number; /* Disable town, industry and trees in SE */ @@ -549,12 +535,6 @@ struct GenerateLandscapeWindow : public Window { ShowDropDownMenu(this, _num_inds, _settings_newgame.difficulty.industry_density, WID_GL_INDUSTRY_PULLDOWN, 0, 0); break; - case WID_GL_RANDOM_BUTTON: // Random seed - _settings_newgame.game_creation.generation_seed = InteractiveRandom(); - this->seed_editbox.text.Print("%u", _settings_newgame.game_creation.generation_seed); - this->SetDirty(); - break; - case WID_GL_GENERATE_BUTTON: { // Generate /* Get rotated map size. */ uint map_x; @@ -695,17 +675,6 @@ struct GenerateLandscapeWindow : public Window { } } - virtual void OnEditboxChanged(int wid) - { - if (wid == WID_GL_RANDOM_EDITBOX) { - /* the seed is unsigned, therefore atoi cannot be used. - * As UINT32_MAX is a 'magic' value (use random seed) it - * should not be possible to be entered into the input - * field; the generate seed button can be used instead. */ - _settings_newgame.game_creation.generation_seed = minu(strtoul(this->seed_editbox.text.buf, NULL, 10), UINT32_MAX - 1); - } - } - virtual void OnDropdownSelect(int widget, int index) { switch (widget) { @@ -819,8 +788,8 @@ static void _ShowGenerateLandscape(GenenerateLandscapeWindowMode mode) DeleteWindowByClass(WC_GENERATE_LANDSCAPE); - /* Always give a new seed if not editor */ - if (_game_mode != GM_EDITOR) _settings_newgame.game_creation.generation_seed = InteractiveRandom(); + /* Generate a new seed when opening the window */ + _settings_newgame.game_creation.generation_seed = InteractiveRandom(); if (mode == GLWM_HEIGHTMAP) { /* If the function returns negative, it means there was a problem loading the heightmap */ diff --git a/src/lang/english.txt b/src/lang/english.txt index 8848710d1..f6f9c2817 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2684,10 +2684,7 @@ STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}No. of i STR_MAPGEN_SNOW_LINE_HEIGHT :{BLACK}Snow line height: STR_MAPGEN_SNOW_LINE_UP :{BLACK}Move the snow line height one up STR_MAPGEN_SNOW_LINE_DOWN :{BLACK}Move the snow line height one down -STR_MAPGEN_RANDOM_SEED :{BLACK}Random seed: -STR_MAPGEN_RANDOM_SEED_HELP :{BLACK}Click to enter a random seed STR_MAPGEN_RANDOM :{BLACK}Randomise -STR_MAPGEN_RANDOM_HELP :{BLACK}Change the random seed used for Terrain Generation STR_MAPGEN_LAND_GENERATOR :{BLACK}Land generator: STR_MAPGEN_TREE_PLACER :{BLACK}Tree algorithm: STR_MAPGEN_TERRAIN_TYPE :{BLACK}Terrain type: @@ -2714,7 +2711,6 @@ STR_MAPGEN_HEIGHTMAP_NAME :{BLACK}Heightma STR_MAPGEN_HEIGHTMAP_SIZE_LABEL :{BLACK}Size: STR_MAPGEN_HEIGHTMAP_SIZE :{ORANGE}{NUM} x {NUM} -STR_MAPGEN_RANDOM_SEED_OSKTITLE :{BLACK}Enter a random seed STR_MAPGEN_SNOW_LINE_QUERY_CAPT :{WHITE}Change snow line height STR_MAPGEN_START_DATE_QUERY_CAPT :{WHITE}Change starting year diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq index 32ad862a7..52e570ef0 100644 --- a/src/script/api/game/game_window.hpp.sq +++ b/src/script/api/game/game_window.hpp.sq @@ -454,8 +454,6 @@ void SQGSWindow_Register(Squirrel *engine) SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_MAPSIZE_Y_PULLDOWN, "WID_GL_MAPSIZE_Y_PULLDOWN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_TOWN_PULLDOWN, "WID_GL_TOWN_PULLDOWN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_INDUSTRY_PULLDOWN, "WID_GL_INDUSTRY_PULLDOWN"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_RANDOM_EDITBOX, "WID_GL_RANDOM_EDITBOX"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_RANDOM_BUTTON, "WID_GL_RANDOM_BUTTON"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_GENERATE_BUTTON, "WID_GL_GENERATE_BUTTON"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_START_DATE_DOWN, "WID_GL_START_DATE_DOWN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_START_DATE_TEXT, "WID_GL_START_DATE_TEXT"); diff --git a/src/script/api/script_window.hpp b/src/script/api/script_window.hpp index f58ea0229..28db09859 100644 --- a/src/script/api/script_window.hpp +++ b/src/script/api/script_window.hpp @@ -1278,9 +1278,6 @@ public: WID_GL_TOWN_PULLDOWN = ::WID_GL_TOWN_PULLDOWN, ///< Dropdown 'No. of towns'. WID_GL_INDUSTRY_PULLDOWN = ::WID_GL_INDUSTRY_PULLDOWN, ///< Dropdown 'No. of industries'. - WID_GL_RANDOM_EDITBOX = ::WID_GL_RANDOM_EDITBOX, ///< 'Random seed' editbox. - WID_GL_RANDOM_BUTTON = ::WID_GL_RANDOM_BUTTON, ///< 'Randomise' button. - WID_GL_GENERATE_BUTTON = ::WID_GL_GENERATE_BUTTON, ///< 'Generate' button. WID_GL_START_DATE_DOWN = ::WID_GL_START_DATE_DOWN, ///< Decrease start year. diff --git a/src/widgets/genworld_widget.h b/src/widgets/genworld_widget.h index 10727f103..2048851ff 100644 --- a/src/widgets/genworld_widget.h +++ b/src/widgets/genworld_widget.h @@ -25,9 +25,6 @@ enum GenerateLandscapeWidgets { WID_GL_TOWN_PULLDOWN, ///< Dropdown 'No. of towns'. WID_GL_INDUSTRY_PULLDOWN, ///< Dropdown 'No. of industries'. - WID_GL_RANDOM_EDITBOX, ///< 'Random seed' editbox. - WID_GL_RANDOM_BUTTON, ///< 'Randomise' button. - WID_GL_GENERATE_BUTTON, ///< 'Generate' button. WID_GL_START_DATE_DOWN, ///< Decrease start year. |