MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OrderClick_Delete

Method OrderClick_Delete

src/order_gui.cpp:703–712  ·  view source on GitHub ↗

* Handle the click on the delete button. */

Source from the content-addressed store, hash-verified

701 * Handle the click on the delete button.
702 */
703 void OrderClick_Delete()
704 {
705 /* When networking, move one order lower */
706 int selected = this->selected_order + (int)_networking;
707
708 if (Command<CMD_DELETE_ORDER>::Post(STR_ERROR_CAN_T_DELETE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel())) {
709 this->selected_order = selected >= this->vehicle->GetNumOrders() ? -1 : selected;
710 this->UpdateButtonState();
711 }
712 }
713
714 /**
715 * Handle the click on the 'stop sharing' button.

Callers 4

OnClickMethod · 0.95
OnDragDropMethod · 0.95
OnHotkeyMethod · 0.95

Calls 3

OrderGetSelMethod · 0.95
UpdateButtonStateMethod · 0.95
GetNumOrdersMethod · 0.45

Tested by

no test coverage detected