1
0
Fork 0

Remove: Unnecessary specialization of NewGRF preset list item.

pull/7358/head
peter1138 2019-03-10 00:05:37 +00:00 committed by Charles Pigott
parent 811bf22620
commit 303cfd86a3
1 changed files with 1 additions and 19 deletions

View File

@ -567,24 +567,6 @@ void ShowNewGRFTextfileWindow(TextfileType file_type, const GRFConfig *c)
static GRFPresetList _grf_preset_list; ///< List of known NewGRF presets. @see GetGRFPresetList
class DropDownListPresetItem : public DropDownListItem {
public:
DropDownListPresetItem(int result) : DropDownListItem(result, false) {}
virtual ~DropDownListPresetItem() {}
bool Selectable() const
{
return true;
}
void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const
{
DrawString(left + 2, right + 2, top, _grf_preset_list[this->result], sel ? TC_WHITE : TC_BLACK);
}
};
typedef std::map<uint32, const GRFConfig *> GrfIdMap; ///< Map of grfid to the grf config.
/**
@ -949,7 +931,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
for (uint i = 0; i < _grf_preset_list.Length(); i++) {
if (_grf_preset_list[i] != NULL) {
*list->Append() = new DropDownListPresetItem(i);
*list->Append() = new DropDownListCharStringItem(_grf_preset_list[i], i, false);
}
}