* Handle the click on the refit button. * If ctrl is pressed, cancel refitting, else show the refit window. * @param i Selected refit command. * @param auto_refit Select refit for auto-refitting. */
| 742 | * @param auto_refit Select refit for auto-refitting. |
| 743 | */ |
| 744 | void OrderClick_Refit(int i, bool auto_refit) |
| 745 | { |
| 746 | if (_ctrl_pressed) { |
| 747 | /* Cancel refitting */ |
| 748 | Command<CMD_ORDER_REFIT>::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CARGO_NO_REFIT); |
| 749 | } else { |
| 750 | if (i == 1) { // Auto-refit to available cargo type. |
| 751 | Command<CMD_ORDER_REFIT>::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CARGO_AUTO_REFIT); |
| 752 | } else { |
| 753 | ShowVehicleRefitWindow(this->vehicle, this->OrderGetSel(), this, auto_refit); |
| 754 | } |
| 755 | } |
| 756 | } |
| 757 | |
| 758 | /** Cache auto-refittability of the vehicle chain. */ |
| 759 | void UpdateAutoRefitState() |
no test coverage detected