order_gui.c
changeset 4719 fc6e14219f72
parent 4715 175674c3036f
child 4782 6aa485b21dae
equal deleted inserted replaced
4718:7ea19105eeac 4719:fc6e14219f72
   347 }
   347 }
   348 
   348 
   349 static void OrderClick_Goto(Window *w, const Vehicle *v)
   349 static void OrderClick_Goto(Window *w, const Vehicle *v)
   350 {
   350 {
   351 	InvalidateWidget(w, 7);
   351 	InvalidateWidget(w, 7);
   352 	TOGGLEBIT(w->click_state, 7);
   352 	ToggleWidgetLoweredState(w, 7);
   353 	if (HASBIT(w->click_state, 7)) {
   353 	if (IsWindowWidgetLowered(w, 7)) {
   354 		_place_clicked_vehicle = NULL;
   354 		_place_clicked_vehicle = NULL;
   355 		SetObjectToPlaceWnd(ANIMCURSOR_PICKSTATION, 1, w);
   355 		SetObjectToPlaceWnd(ANIMCURSOR_PICKSTATION, 1, w);
   356 	} else {
   356 	} else {
   357 		ResetObjectToPlace();
   357 		ResetObjectToPlace();
   358 	}
   358 	}
   530 	case WE_PLACE_OBJ: {
   530 	case WE_PLACE_OBJ: {
   531 		OrdersPlaceObj(GetVehicle(w->window_number), e->we.place.tile, w);
   531 		OrdersPlaceObj(GetVehicle(w->window_number), e->we.place.tile, w);
   532 	} break;
   532 	} break;
   533 
   533 
   534 	case WE_ABORT_PLACE_OBJ: {
   534 	case WE_ABORT_PLACE_OBJ: {
   535 		CLRBIT(w->click_state, 7);
   535 		RaiseWindowWidget(w, 7);
   536 		InvalidateWidget(w, 7);
   536 		InvalidateWidget(w, 7);
   537 	} break;
   537 	} break;
   538 
   538 
   539 	// check if a vehicle in a depot was clicked..
   539 	// check if a vehicle in a depot was clicked..
   540 	case WE_MOUSELOOP: {
   540 	case WE_MOUSELOOP: {
   545 		 * This is because of all open order windows WE_MOUSELOOP is called
   545 		 * This is because of all open order windows WE_MOUSELOOP is called
   546 		 * and if you have 3 windows open, and this check is not done
   546 		 * and if you have 3 windows open, and this check is not done
   547 		 * the order is copied to the last open window instead of the
   547 		 * the order is copied to the last open window instead of the
   548 		 * one where GOTO is enalbed
   548 		 * one where GOTO is enalbed
   549 		 */
   549 		 */
   550 		if (v != NULL && HASBIT(w->click_state, 7)) {
   550 		if (v != NULL && IsWindowWidgetLowered(w, 7)) {
   551 			_place_clicked_vehicle = NULL;
   551 			_place_clicked_vehicle = NULL;
   552 			HandleOrderVehClick(GetVehicle(w->window_number), v, w);
   552 			HandleOrderVehClick(GetVehicle(w->window_number), v, w);
   553 		}
   553 		}
   554 	} break;
   554 	} break;
   555 
   555