roadveh_gui.c
changeset 3157 3f35e2d9c8e3
parent 3049 d6109b5fd55d
child 3236 004a4e2bf30c
equal deleted inserted replaced
3156:f4caf4197189 3157:3f35e2d9c8e3
    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);