Codechange: Use functions to create common drop down list items.

This commit is contained in:
Peter Nelson
2024-03-31 17:31:47 +01:00
committed by Peter Nelson
parent 11aa3694fa
commit 56cac21086
22 changed files with 190 additions and 136 deletions

View File

@@ -16,6 +16,7 @@
#include "string_func.h"
#include "textfile_gui.h"
#include "dropdown_type.h"
#include "dropdown_func.h"
#include "gfx_layout.h"
#include "debug.h"
#include "openttd.h"
@@ -534,7 +535,7 @@ void TextfileWindow::AfterLoadMarkdown()
DropDownList list;
for (size_t line : this->jumplist) {
SetDParamStr(0, this->lines[line].text);
list.push_back(std::make_unique<DropDownListStringItem>(STR_TEXTFILE_JUMPLIST_ITEM, (int)line, false));
list.push_back(MakeDropDownListStringItem(STR_TEXTFILE_JUMPLIST_ITEM, (int)line));
}
ShowDropDownList(this, std::move(list), -1, widget);
break;