Change: Use CRTP-mixins to compose dropdown list items.

This allows list items to built from component parts as required, and additional
functionality is added:

* Icons and text can be positioned at the start or end of the space (templated.)
* Font size of text can be changed (templated.)
* Palette of sprites can be set (runtime.)
This commit is contained in:
Peter Nelson
2023-11-11 15:17:12 +00:00
committed by Peter Nelson
parent 62e4d1e507
commit 49532914dd
6 changed files with 201 additions and 241 deletions

View File

@@ -358,7 +358,7 @@ static DropDownList BuildTownNameDropDown()
size_t newgrf_size = list.size();
/* Insert newgrf_names at the top of the list */
if (newgrf_size > 0) {
list.push_back(std::make_unique<DropDownListItem>(-1, false)); // separator line
list.push_back(std::make_unique<DropDownListDividerItem>(-1, false)); // separator line
newgrf_size++;
}