From 303cfd86a301bcd66a6fec48dec944afd2174231 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 10 Mar 2019 00:05:37 +0000 Subject: Remove: Unnecessary specialization of NewGRF preset list item. --- src/newgrf_gui.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src') diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 23c037d10..4e66d2e52 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -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 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); } } -- cgit v1.2.3-70-g09d2