forked from mirror/OpenTTD
Codechange: Use functions to create common drop down list items.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "date_gui.h"
|
||||
#include "core/geometry_func.hpp"
|
||||
#include "dropdown_type.h"
|
||||
#include "dropdown_func.h"
|
||||
|
||||
#include "widgets/date_widget.h"
|
||||
|
||||
@@ -75,14 +76,14 @@ struct SetDateWindow : Window {
|
||||
|
||||
case WID_SD_DAY:
|
||||
for (uint i = 0; i < 31; i++) {
|
||||
list.push_back(std::make_unique<DropDownListStringItem>(STR_DAY_NUMBER_1ST + i, i + 1, false));
|
||||
list.push_back(MakeDropDownListStringItem(STR_DAY_NUMBER_1ST + i, i + 1));
|
||||
}
|
||||
selected = this->date.day;
|
||||
break;
|
||||
|
||||
case WID_SD_MONTH:
|
||||
for (uint i = 0; i < 12; i++) {
|
||||
list.push_back(std::make_unique<DropDownListStringItem>(STR_MONTH_JAN + i, i, false));
|
||||
list.push_back(MakeDropDownListStringItem(STR_MONTH_JAN + i, i));
|
||||
}
|
||||
selected = this->date.month;
|
||||
break;
|
||||
@@ -90,7 +91,7 @@ struct SetDateWindow : Window {
|
||||
case WID_SD_YEAR:
|
||||
for (TimerGameEconomy::Year i = this->min_year; i <= this->max_year; i++) {
|
||||
SetDParam(0, i);
|
||||
list.push_back(std::make_unique<DropDownListStringItem>(STR_JUST_INT, i.base(), false));
|
||||
list.push_back(MakeDropDownListStringItem(STR_JUST_INT, i.base()));
|
||||
}
|
||||
selected = this->date.year.base();
|
||||
break;
|
||||
|
Reference in New Issue
Block a user