mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r24467) -Codechange [FS#5236]: make textfile window class slightly more general (LordAro)
This commit is contained in:
parent
483d878d5f
commit
5192155253
|
@ -646,8 +646,6 @@ struct ScriptTextfileWindow : public TextfileWindow {
|
|||
|
||||
ScriptTextfileWindow(TextfileType file_type, CompanyID slot) : TextfileWindow(file_type), slot(slot)
|
||||
{
|
||||
this->GetWidget<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
|
||||
|
||||
const char *textfile = GetConfig(slot)->GetTextfile(file_type, slot);
|
||||
this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR);
|
||||
}
|
||||
|
|
|
@ -542,8 +542,6 @@ struct NewGRFTextfileWindow : public TextfileWindow {
|
|||
|
||||
NewGRFTextfileWindow(TextfileType file_type, const GRFConfig *c) : TextfileWindow(file_type), grf_config(c)
|
||||
{
|
||||
this->GetWidget<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
|
||||
|
||||
const char *textfile = this->grf_config->GetTextfile(file_type);
|
||||
this->LoadTextfile(textfile, NEWGRF_DIR);
|
||||
}
|
||||
|
|
|
@ -127,8 +127,6 @@ struct BaseSetTextfileWindow : public TextfileWindow {
|
|||
|
||||
BaseSetTextfileWindow(TextfileType file_type, const TBaseSet* baseset, StringID content_type) : TextfileWindow(file_type), baseset(baseset), content_type(content_type)
|
||||
{
|
||||
this->GetWidget<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
|
||||
|
||||
const char *textfile = this->baseset->GetTextfile(file_type);
|
||||
this->LoadTextfile(textfile, BASESET_DIR);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ TextfileWindow::TextfileWindow(TextfileType file_type) : Window(), file_type(fil
|
|||
this->vscroll = this->GetScrollbar(WID_TF_VSCROLLBAR);
|
||||
this->hscroll = this->GetScrollbar(WID_TF_HSCROLLBAR);
|
||||
this->FinishInitNested(&_textfile_desc);
|
||||
this->GetWidget<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
|
||||
}
|
||||
|
||||
/* virtual */ TextfileWindow::~TextfileWindow()
|
||||
|
|
Loading…
Reference in New Issue