summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2012-04-17 19:44:02 +0000
committermichi_cc <michi_cc@openttd.org>2012-04-17 19:44:02 +0000
commit6a70abbd998ed5b54d52ddb44b4df8521413185c (patch)
tree25d404a46a68f3fa314dd27a4b9555ac4bc1a886 /src/widget.cpp
parented565853889679a409d601a61d661718ac3498cc (diff)
downloadopenttd-6a70abbd998ed5b54d52ddb44b4df8521413185c.tar.xz
(svn r24136) -Feature [FS#4465]: Autoreplace vehicles only when they get old. (Vikthor)
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp7
1 files changed, 5 insertions, 2 deletions
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;