mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Add: allow opening of one TextfileWindow per type
This commit is contained in:
parent
310fa1af88
commit
b22fbfbe3d
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ struct BaseSetTextfileWindow : public TextfileWindow {
|
||||
template <class TBaseSet>
|
||||
void ShowBaseSetTextfileWindow(TextfileType file_type, const TBaseSet* baseset, StringID content_type)
|
||||
{
|
||||
DeleteWindowByClass(WC_TEXTFILE);
|
||||
DeleteWindowById(WC_TEXTFILE, file_type);
|
||||
new BaseSetTextfileWindow<TBaseSet>(file_type, baseset, content_type);
|
||||
}
|
||||
|
||||
|
@ -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<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
|
||||
|
||||
this->hscroll->SetStepSize(10); // Speed up horizontal scrollbar
|
||||
|
Loading…
Reference in New Issue
Block a user