equal
deleted
inserted
replaced
354 } |
354 } |
355 } |
355 } |
356 |
356 |
357 static void OrderClick_Goto(Window *w, const Vehicle *v) |
357 static void OrderClick_Goto(Window *w, const Vehicle *v) |
358 { |
358 { |
359 InvalidateWidget(w, ORDER_WIDGET_GOTO); |
359 w->InvalidateWidget(ORDER_WIDGET_GOTO); |
360 ToggleWidgetLoweredState(w, ORDER_WIDGET_GOTO); |
360 ToggleWidgetLoweredState(w, ORDER_WIDGET_GOTO); |
361 if (IsWindowWidgetLowered(w, ORDER_WIDGET_GOTO)) { |
361 if (IsWindowWidgetLowered(w, ORDER_WIDGET_GOTO)) { |
362 _place_clicked_vehicle = NULL; |
362 _place_clicked_vehicle = NULL; |
363 SetObjectToPlaceWnd(ANIMCURSOR_PICKSTATION, PAL_NONE, 1, w); |
363 SetObjectToPlaceWnd(ANIMCURSOR_PICKSTATION, PAL_NONE, 1, w); |
364 } else { |
364 } else { |
547 OrdersPlaceObj(GetVehicle(w->window_number), e->we.place.tile, w); |
547 OrdersPlaceObj(GetVehicle(w->window_number), e->we.place.tile, w); |
548 } break; |
548 } break; |
549 |
549 |
550 case WE_ABORT_PLACE_OBJ: { |
550 case WE_ABORT_PLACE_OBJ: { |
551 RaiseWindowWidget(w, ORDER_WIDGET_GOTO); |
551 RaiseWindowWidget(w, ORDER_WIDGET_GOTO); |
552 InvalidateWidget( w, ORDER_WIDGET_GOTO); |
552 w->InvalidateWidget( ORDER_WIDGET_GOTO); |
553 } break; |
553 } break; |
554 |
554 |
555 // check if a vehicle in a depot was clicked.. |
555 // check if a vehicle in a depot was clicked.. |
556 case WE_MOUSELOOP: { |
556 case WE_MOUSELOOP: { |
557 const Vehicle *v = _place_clicked_vehicle; |
557 const Vehicle *v = _place_clicked_vehicle; |
578 // unclick all buttons except for the 'goto' button (ORDER_WIDGET_GOTO), which is 'persistent' |
578 // unclick all buttons except for the 'goto' button (ORDER_WIDGET_GOTO), which is 'persistent' |
579 uint i; |
579 uint i; |
580 for (i = 0; i < w->widget_count; i++) { |
580 for (i = 0; i < w->widget_count; i++) { |
581 if (IsWindowWidgetLowered(w, i) && i != ORDER_WIDGET_GOTO) { |
581 if (IsWindowWidgetLowered(w, i) && i != ORDER_WIDGET_GOTO) { |
582 RaiseWindowWidget(w, i); |
582 RaiseWindowWidget(w, i); |
583 InvalidateWidget(w, i); |
583 w->InvalidateWidget(i); |
584 } |
584 } |
585 } |
585 } |
586 } break; |
586 } break; |
587 } |
587 } |
588 } |
588 } |