diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 8dad16fabc..aa56b3d830 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -660,7 +660,7 @@ struct ScriptTextfileWindow : public TextfileWindow { */ void ShowScriptTextfileWindow(TextfileType file_type, CompanyID slot) { - DeleteWindowByClass(WC_TEXTFILE); + DeleteWindowById(WC_TEXTFILE, file_type); new ScriptTextfileWindow(file_type, slot); } diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 1df2fc82c4..877dea9786 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -76,7 +76,7 @@ struct ContentTextfileWindow : public TextfileWindow { void ShowContentTextfileWindow(TextfileType file_type, const ContentInfo *ci) { - DeleteWindowByClass(WC_TEXTFILE); + DeleteWindowById(WC_TEXTFILE, file_type); new ContentTextfileWindow(file_type, ci); } diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 140e296571..868fad968b 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -561,7 +561,7 @@ struct NewGRFTextfileWindow : public TextfileWindow { void ShowNewGRFTextfileWindow(TextfileType file_type, const GRFConfig *c) { - DeleteWindowByClass(WC_TEXTFILE); + DeleteWindowById(WC_TEXTFILE, file_type); new NewGRFTextfileWindow(file_type, c); } diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 134b1f58ff..e94f96bc46 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -162,7 +162,7 @@ struct BaseSetTextfileWindow : public TextfileWindow { template void ShowBaseSetTextfileWindow(TextfileType file_type, const TBaseSet* baseset, StringID content_type) { - DeleteWindowByClass(WC_TEXTFILE); + DeleteWindowById(WC_TEXTFILE, file_type); new BaseSetTextfileWindow(file_type, baseset, content_type); } diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index b0f9b1125a..ff5226c2b5 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -65,7 +65,7 @@ TextfileWindow::TextfileWindow(TextfileType file_type) : Window(&_textfile_desc) this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_TF_VSCROLLBAR); this->hscroll = this->GetScrollbar(WID_TF_HSCROLLBAR); - this->FinishInitNested(); + this->FinishInitNested(file_type); this->GetWidget(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS); this->hscroll->SetStepSize(10); // Speed up horizontal scrollbar