* Handle the click on the full load button. * @param load_type Load flag to apply. If matches existing load type, toggles to default of 'load if possible'. * @param toggle If we toggle or not (used for hotkey behavior) */
| 593 | * @param toggle If we toggle or not (used for hotkey behavior) |
| 594 | */ |
| 595 | void OrderClick_FullLoad(OrderLoadType load_type, bool toggle = false) |
| 596 | { |
| 597 | VehicleOrderID sel_ord = this->OrderGetSel(); |
| 598 | const Order *order = this->vehicle->GetOrder(sel_ord); |
| 599 | |
| 600 | if (order == nullptr) return; |
| 601 | |
| 602 | if (toggle && order->GetLoadType() == load_type) { |
| 603 | load_type = OrderLoadType::LoadIfPossible; // reset to 'default' |
| 604 | } |
| 605 | if (order->GetLoadType() == load_type) return; // If we still match, do nothing |
| 606 | |
| 607 | Command<CMD_MODIFY_ORDER>::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index, sel_ord, MOF_LOAD, to_underlying(load_type)); |
| 608 | } |
| 609 | |
| 610 | /** |
| 611 | * Handle the click on the service. |
no test coverage detected