Change: Show "Delete All" in order window delete button when applicable (#15370)

This commit is contained in:
Jonathan G Rennison
2026-03-05 22:56:20 +00:00
committed by GitHub
parent 182a2c5100
commit 71d59aaf3d
2 changed files with 10 additions and 1 deletions
+1
View File
@@ -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
+9 -1
View File
@@ -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<NWidgetCore>(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);
}