summaryrefslogtreecommitdiff
path: root/src/fios_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-14 22:50:17 +0000
committerfrosch <frosch@openttd.org>2012-11-14 22:50:17 +0000
commitf6d4200f86e93828a4a58a957d6ae7d9d5497a86 (patch)
tree2d940ae42f1f273a19c2c33f2858feab9122d9c2 /src/fios_gui.cpp
parent0ea21523556a345d38933ee2dd6dcdca0ec08514 (diff)
downloadopenttd-f6d4200f86e93828a4a58a957d6ae7d9d5497a86.tar.xz
(svn r24738) -Codechange: Remove Textbuf::Initialize in favour of a constructor.
Diffstat (limited to 'src/fios_gui.cpp')
-rw-r--r--src/fios_gui.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 8cf3c840a..6eac9315e 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -239,6 +239,7 @@ public:
void GenerateFileName()
{
GenerateDefaultSaveName(this->edit_str_buf, &this->edit_str_buf[this->edit_str_size - 1]);
+ this->text.UpdateSize();
}
SaveLoadWindow(const WindowDesc *desc, SaveLoadDialogMode mode) : QueryStringBaseWindow(64)
@@ -258,13 +259,12 @@ public:
switch (mode) {
case SLD_SAVE_GAME: this->GenerateFileName(); break;
case SLD_SAVE_HEIGHTMAP:
- case SLD_SAVE_SCENARIO: strecpy(this->edit_str_buf, "UNNAMED", &this->edit_str_buf[edit_str_size - 1]); break;
+ case SLD_SAVE_SCENARIO: this->text.Assign("UNNAMED"); break;
default: break;
}
this->ok_button = WID_SL_SAVE_GAME;
this->afilter = CS_ALPHANUMERAL;
- this->text.Initialize(this->edit_str_buf, this->edit_str_size);
this->CreateNestedTree(desc, true);
if (mode == SLD_LOAD_GAME) this->GetWidget<NWidgetStacked>(WID_SL_CONTENT_DOWNLOAD_SEL)->SetDisplayedPlane(SZSP_HORIZONTAL);
@@ -639,8 +639,6 @@ public:
/* Reset file name to current date on successful delete */
if (_saveload_mode == SLD_SAVE_GAME) GenerateFileName();
}
-
- this->text.UpdateSize();
} else if (this->IsWidgetLowered(WID_SL_SAVE_GAME)) { // Save button clicked
if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) {
_switch_mode = SM_SAVE_GAME;