summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2019-03-10 00:05:37 +0000
committerCharles Pigott <charlespigott@googlemail.com>2019-03-10 09:20:11 +0000
commit303cfd86a301bcd66a6fec48dec944afd2174231 (patch)
tree4380f18fdd86a7e0ca7ba21a2867f1adbc7ee5c9 /src
parent811bf2262019b855c9005793e5efc725ac77a7b3 (diff)
downloadopenttd-303cfd86a301bcd66a6fec48dec944afd2174231.tar.xz
Remove: Unnecessary specialization of NewGRF preset list item.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_gui.cpp20
1 files changed, 1 insertions, 19 deletions
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<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);
}
}