src/depot_gui.cpp
branchnoai
changeset 9732 f8eb3e208514
parent 9724 b39bc69bb2f2
child 9837 c9ec4f82e0d0
equal deleted inserted replaced
9731:9b1552d0fd9b 9732:f8eb3e208514
   517 
   517 
   518 /* Function to set up vehicle specific sprites and strings
   518 /* Function to set up vehicle specific sprites and strings
   519  * Only use this if it's the same widget, that's used for more than one vehicle type and it needs different text/sprites
   519  * Only use this if it's the same widget, that's used for more than one vehicle type and it needs different text/sprites
   520  * Vehicle specific text/sprites, that's in a widget, that's only shown for one vehicle type (like sell whole train) is set in the widget array
   520  * Vehicle specific text/sprites, that's in a widget, that's only shown for one vehicle type (like sell whole train) is set in the widget array
   521  */
   521  */
   522 static void SetupStringsForDepotWindow(Window *w, byte type)
   522 static void SetupStringsForDepotWindow(Window *w, VehicleType type)
   523 {
   523 {
   524 	switch (type) {
   524 	switch (type) {
       
   525 		default: NOT_REACHED();
       
   526 
   525 		case VEH_TRAIN:
   527 		case VEH_TRAIN:
   526 			w->widget[DEPOT_WIDGET_CAPTION].data      = STR_8800_TRAIN_DEPOT;
   528 			w->widget[DEPOT_WIDGET_CAPTION].data      = STR_8800_TRAIN_DEPOT;
   527 			w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_DEPOT_TRAIN_TIP;
   529 			w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_DEPOT_TRAIN_TIP;
   528 			w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_DEPOT_TRAIN_TIP;
   530 			w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_DEPOT_TRAIN_TIP;
   529 			w->widget[DEPOT_WIDGET_SELL].tooltips     = STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE;
   531 			w->widget[DEPOT_WIDGET_SELL].tooltips     = STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE;
   856 		case WE_PLACE_OBJ: {
   858 		case WE_PLACE_OBJ: {
   857 			ClonePlaceObj(w);
   859 			ClonePlaceObj(w);
   858 		} break;
   860 		} break;
   859 
   861 
   860 		case WE_ABORT_PLACE_OBJ: {
   862 		case WE_ABORT_PLACE_OBJ: {
       
   863 			/* abort clone */
   861 			w->RaiseWidget(DEPOT_WIDGET_CLONE);
   864 			w->RaiseWidget(DEPOT_WIDGET_CLONE);
   862 			w->InvalidateWidget(DEPOT_WIDGET_CLONE);
   865 			w->InvalidateWidget(DEPOT_WIDGET_CLONE);
       
   866 
       
   867 			/* abort drag & drop */
       
   868 			WP(w, depot_d).sel = INVALID_VEHICLE;
       
   869 			w->InvalidateWidget(DEPOT_WIDGET_MATRIX);
   863 		} break;
   870 		} break;
   864 
   871 
   865 			/* check if a vehicle in a depot was clicked.. */
   872 			/* check if a vehicle in a depot was clicked.. */
   866 		case WE_MOUSELOOP: {
   873 		case WE_MOUSELOOP: {
   867 			const Vehicle *v = _place_clicked_vehicle;
   874 			const Vehicle *v = _place_clicked_vehicle;