diff options
author | alberth <alberth@openttd.org> | 2010-02-13 14:00:45 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-02-13 14:00:45 +0000 |
commit | c1b40ee5e0762fd8e2a6f4810ea3f3c363cd21bc (patch) | |
tree | 1c2a5de726ce3fad954cd1d5b996c1c7da5ff0a6 /src | |
parent | ff80df980a69fdb14540841969be489bbd655a4c (diff) | |
download | openttd-c1b40ee5e0762fd8e2a6f4810ea3f3c363cd21bc.tar.xz |
(svn r19118) -Fix [FS#3593]: Some buttons in the order gui were raised too soon.
Diffstat (limited to 'src')
-rw-r--r-- | src/order_gui.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 23e970d84..73760fec1 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -1297,13 +1297,15 @@ public: virtual void OnTimeout() { - /* unclick all buttons except for the 'goto' button (ORDER_WIDGET_GOTO), which is 'persistent' */ - for (uint i = 0; i < this->nested_array_size; i++) { - if (this->nested_array[i] != NULL && i != ORDER_WIDGET_GOTO && - i != ORDER_WIDGET_SEL_TOP_LEFT && i != ORDER_WIDGET_SEL_TOP_MIDDLE && i != ORDER_WIDGET_SEL_TOP_RIGHT && - i != ORDER_WIDGET_SEL_TOP_ROW && this->IsWidgetLowered(i)) { - this->RaiseWidget(i); - this->SetWidgetDirty(i); + static const int raise_widgets[] = { + ORDER_WIDGET_SKIP, ORDER_WIDGET_DELETE, ORDER_WIDGET_REFIT, ORDER_WIDGET_SHARED_ORDER_LIST, WIDGET_LIST_END, + }; + + /* Unclick all buttons in raise_widgets[]. */ + for (const int *widnum = raise_widgets; *widnum != WIDGET_LIST_END; widnum++) { + if (this->IsWidgetLowered(*widnum)) { + this->RaiseWidget(*widnum); + this->SetWidgetDirty(*widnum); } } } |