From 71d59aaf3d3e22127dd44e5158ff4ec65f37a3b2 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 5 Mar 2026 22:56:20 +0000 Subject: [PATCH] Change: Show "Delete All" in order window delete button when applicable (#15370) --- src/lang/english.txt | 1 + src/order_gui.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index cafeeffab6..509b662114 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -4759,6 +4759,7 @@ STR_ORDERS_SKIP_BUTTON :{BLACK}Skip STR_ORDERS_SKIP_TOOLTIP :{BLACK}Skip the current order, and start the next. Ctrl+Click to skip to the selected order STR_ORDERS_DELETE_BUTTON :{BLACK}Delete +STR_ORDERS_DELETE_ALL_BUTTON :{BLACK}Delete All STR_ORDERS_DELETE_TOOLTIP :{BLACK}Delete the highlighted order STR_ORDERS_DELETE_ALL_TOOLTIP :{BLACK}Delete all orders STR_ORDERS_STOP_SHARING_BUTTON :{BLACK}Stop sharing diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 9a6ad2cadd..ac32f9a7b7 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -819,6 +819,14 @@ public: size = maxdim(size, d); break; } + + case WID_O_DELETE: { + Dimension d = maxdim(GetStringBoundingBox(STR_ORDERS_DELETE_BUTTON), GetStringBoundingBox(STR_ORDERS_DELETE_ALL_BUTTON)); + d.width += padding.width; + d.height += padding.height; + size = maxdim(size, d); + break; + } } } @@ -924,7 +932,7 @@ public: * 'End of Orders' order or a regular order is selected. */ NWidgetCore *nwi = this->GetWidget(WID_O_DELETE); if (this->selected_order == this->vehicle->GetNumOrders()) { - nwi->SetStringTip(STR_ORDERS_DELETE_BUTTON, STR_ORDERS_DELETE_ALL_TOOLTIP); + nwi->SetStringTip(STR_ORDERS_DELETE_ALL_BUTTON, STR_ORDERS_DELETE_ALL_TOOLTIP); } else { nwi->SetStringTip(STR_ORDERS_DELETE_BUTTON, STR_ORDERS_DELETE_TOOLTIP); }