summaryrefslogtreecommitdiff
path: root/src/genworld_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-14 22:50:35 +0000
committerfrosch <frosch@openttd.org>2012-11-14 22:50:35 +0000
commitf5d8ba5d7f90abc72db6c0470da383ecf82da487 (patch)
tree3dbbbbe18733005c5851251dac62314d871b2b30 /src/genworld_gui.cpp
parentdcfb2af871b76a7b65fb959b2f4ebc2da2f9e4d3 (diff)
downloadopenttd-f5d8ba5d7f90abc72db6c0470da383ecf82da487.tar.xz
(svn r24742) -Codechange: Remove QueryStringBaseWindow and store QueryStrings per widget instead.
Diffstat (limited to 'src/genworld_gui.cpp')
-rw-r--r--src/genworld_gui.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 36b785b3e..5273f09d9 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -303,22 +303,24 @@ static const StringID _variety[] = {STR_VARIETY_NONE, STR_VARIETY_VERY_LOW,
assert_compile(lengthof(_num_inds) == ID_END + 1);
-struct GenerateLandscapeWindow : public QueryStringBaseWindow {
+struct GenerateLandscapeWindow : public Window {
uint widget_id;
uint x;
uint y;
char name[64];
GenenerateLandscapeWindowMode mode;
+ QueryString seed_editbox;
- GenerateLandscapeWindow(const WindowDesc *desc, WindowNumber number = 0) : QueryStringBaseWindow(11)
+ GenerateLandscapeWindow(const WindowDesc *desc, WindowNumber number = 0) : seed_editbox(11)
{
this->InitNested(desc, number);
this->LowerWidget(_settings_newgame.game_creation.landscape + WID_GL_TEMPERATE);
- this->text.Print("%u", _settings_newgame.game_creation.generation_seed);
- this->caption = STR_NULL;
- this->afilter = CS_NUMERAL;
+ 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.afilter = CS_NUMERAL;
this->mode = (GenenerateLandscapeWindowMode)this->window_number;
@@ -547,7 +549,7 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
case WID_GL_RANDOM_BUTTON: // Random seed
_settings_newgame.game_creation.generation_seed = InteractiveRandom();
- this->text.Print("%u", _settings_newgame.game_creation.generation_seed);
+ this->seed_editbox.text.Print("%u", _settings_newgame.game_creation.generation_seed);
this->SetDirty();
break;
@@ -698,7 +700,7 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
* 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->text.buf, NULL, 10), UINT32_MAX - 1);
+ _settings_newgame.game_creation.generation_seed = minu(strtoul(this->seed_editbox.text.buf, NULL, 10), UINT32_MAX - 1);
}
}