summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-12 14:46:42 +0000
committerrubidium <rubidium@openttd.org>2010-12-12 14:46:42 +0000
commit15e07279dd1add322c39ace79d80a9b6fdfdbd57 (patch)
treed2dc27789e82ed50086006ffbecc712021fd8fcd /src/order_gui.cpp
parenta029b2b83aa344fdd8ba1f7bc0915205c52daca0 (diff)
downloadopenttd-15e07279dd1add322c39ace79d80a9b6fdfdbd57.tar.xz
(svn r21478) -Change [FS#4297]: improve some order related tooltips. Based on patch by Krille
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 149ffc3f4..bdba6bf64 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -706,7 +706,7 @@ private:
if (!this->vehicle->IsOrderListShared() || this->selected_order != this->vehicle->GetNumOrders()) return;
/* If Ctrl is pressed, delete the order list as if we clicked the 'Delete' button. */
if (_ctrl_pressed) {
- this->OrderClick_Delete(i);
+ this->OrderClick_Delete(0);
return;
}
@@ -879,6 +879,15 @@ public:
delete_sel->SetDisplayedPlane(DP_BOTTOM_MIDDLE_DELETE);
this->SetWidgetDisabledState(ORDER_WIDGET_DELETE,
(uint)this->vehicle->GetNumOrders() + ((shared_orders || this->vehicle->GetNumOrders() != 0) ? 1 : 0) <= (uint)this->selected_order);
+
+ /* Set the tooltip of the 'delete' button depending on whether the
+ * 'End of Orders' order or a regular order is selected. */
+ NWidgetCore *nwi = this->GetWidget<NWidgetCore>(ORDER_WIDGET_DELETE);
+ if (this->selected_order == this->vehicle->GetNumOrders()) {
+ nwi->SetDataTip(STR_ORDERS_DELETE_BUTTON, STR_ORDERS_DELETE_ALL_TOOLTIP);
+ } else {
+ nwi->SetDataTip(STR_ORDERS_DELETE_BUTTON, STR_ORDERS_DELETE_TOOLTIP);
+ }
}
/* First row. */