roadveh_gui.c
changeset 3157 40de8616c04c
parent 3049 b797ca543c13
child 3236 36e8eb3ae55a
equal deleted inserted replaced
3156:028b6756b279 3157:40de8616c04c
    63 }
    63 }
    64 
    64 
    65 static void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection)
    65 static void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection)
    66 {
    66 {
    67 	PalSpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
    67 	PalSpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
    68 	DrawSprite(GetRoadVehImage(v, 6) | pal, x + 14, y + 6);
    68 	DrawSprite(GetRoadVehImage(v, DIR_W) | pal, x + 14, y + 6);
    69 
    69 
    70 	if (v->index == selection) {
    70 	if (v->index == selection) {
    71 		DrawFrameRect(x - 1, y - 1, x + 28, y + 12, 15, FR_BORDERONLY);
    71 		DrawFrameRect(x - 1, y - 1, x + 28, y + 12, 15, FR_BORDERONLY);
    72 	}
    72 	}
    73 }
    73 }
   634 	switch (mode) {
   634 	switch (mode) {
   635 	case 0: // start dragging of vehicle
   635 	case 0: // start dragging of vehicle
   636 		if (v != NULL) {
   636 		if (v != NULL) {
   637 			WP(w,traindepot_d).sel = v->index;
   637 			WP(w,traindepot_d).sel = v->index;
   638 			SetWindowDirty(w);
   638 			SetWindowDirty(w);
   639 			SetObjectToPlaceWnd(GetVehiclePalette(v) | GetRoadVehImage(v, 6), 4, w);
   639 			SetObjectToPlaceWnd(GetVehiclePalette(v) | GetRoadVehImage(v, DIR_W), 4, w);
   640 		}
   640 		}
   641 		break;
   641 		break;
   642 
   642 
   643 	case -1: // show info window
   643 	case -1: // show info window
   644 		ShowRoadVehViewWindow(v);
   644 		ShowRoadVehViewWindow(v);