From 6a70abbd998ed5b54d52ddb44b4df8521413185c Mon Sep 17 00:00:00 2001 From: michi_cc Date: Tue, 17 Apr 2012 19:44:02 +0000 Subject: (svn r24136) -Feature [FS#4465]: Autoreplace vehicles only when they get old. (Vikthor) --- src/widget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/widget.cpp') diff --git a/src/widget.cpp b/src/widget.cpp index 705ee105b..c38a6fa2b 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -2050,6 +2050,7 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data, case WWT_TEXT: case WWT_MATRIX: case NWID_BUTTON_DROPDOWN: + case NWID_PUSHBUTTON_DROPDOWN: case WWT_ARROWBTN: case WWT_PUSHARROWBTN: this->SetFill(0, 0); @@ -2254,7 +2255,8 @@ void NWidgetLeaf::SetupSmallestSize(Window *w, bool init_array) break; } case WWT_DROPDOWN: - case NWID_BUTTON_DROPDOWN: { + case NWID_BUTTON_DROPDOWN: + case NWID_PUSHBUTTON_DROPDOWN: { static const Dimension extra = {WD_DROPDOWNTEXT_LEFT + WD_DROPDOWNTEXT_RIGHT, WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM}; padding = &extra; if (this->index >= 0) w->SetStringParameters(this->index); @@ -2380,6 +2382,7 @@ void NWidgetLeaf::Draw(const Window *w) break; case NWID_BUTTON_DROPDOWN: + case NWID_PUSHBUTTON_DROPDOWN: if (this->index >= 0) w->SetStringParameters(this->index); DrawButtonDropdown(r, this->colour, clicked, (this->disp_flags & ND_DROPDOWN_ACTIVE) != 0, this->widget_data); break; @@ -2582,7 +2585,7 @@ static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, default: if (*dest != NULL) return num_used; - assert((parts->type & WWT_MASK) < WWT_LAST || parts->type == NWID_BUTTON_DROPDOWN); + assert((parts->type & WWT_MASK) < WWT_LAST || (parts->type & WWT_MASK) == NWID_BUTTON_DROPDOWN); *dest = new NWidgetLeaf(parts->type, parts->u.widget.colour, parts->u.widget.index, 0x0, STR_NULL); *biggest_index = max(*biggest_index, (int)parts->u.widget.index); break; -- cgit v1.2.3-54-g00ecf