roadveh_gui.c
changeset 3477 80c3465b38ee
parent 3431 0d7fa19d0b4a
child 3884 475989407ceb
equal deleted inserted replaced
3476:1d130c5ed5e0 3477:80c3465b38ee
    32 	YearMonthDay ymd;
    32 	YearMonthDay ymd;
    33 	ConvertDayToYMD(&ymd, e->intro_date);
    33 	ConvertDayToYMD(&ymd, e->intro_date);
    34 
    34 
    35 	/* Purchase cost - Max speed */
    35 	/* Purchase cost - Max speed */
    36 	SetDParam(0, rvi->base_cost * (_price.roadveh_base>>3)>>5);
    36 	SetDParam(0, rvi->base_cost * (_price.roadveh_base>>3)>>5);
    37 	SetDParam(1, rvi->max_speed * 10 >> 5);
    37 	SetDParam(1, rvi->max_speed / 2);
    38 	DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0);
    38 	DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0);
    39 	y += 10;
    39 	y += 10;
    40 
    40 
    41 	/* Running cost */
    41 	/* Running cost */
    42 	SetDParam(0, rvi->running_cost * _price.roadveh_running >> 8);
    42 	SetDParam(0, rvi->running_cost * _price.roadveh_running >> 8);
    99 			DrawString(2, 15, STR_900D_AGE_RUNNING_COST_YR, 0);
    99 			DrawString(2, 15, STR_900D_AGE_RUNNING_COST_YR, 0);
   100 		}
   100 		}
   101 
   101 
   102 		/* Draw max speed */
   102 		/* Draw max speed */
   103 		{
   103 		{
   104 			SetDParam(0, v->max_speed * 10 >> 5);
   104 			SetDParam(0, v->max_speed / 2);
   105 			DrawString(2, 25, STR_900E_MAX_SPEED, 0);
   105 			DrawString(2, 25, STR_900E_MAX_SPEED, 0);
   106 		}
   106 		}
   107 
   107 
   108 		/* Draw profit */
   108 		/* Draw profit */
   109 		{
   109 		{
   249 			str = STR_8861_STOPPED;
   249 			str = STR_8861_STOPPED;
   250 		} else {
   250 		} else {
   251 			switch (v->current_order.type) {
   251 			switch (v->current_order.type) {
   252 			case OT_GOTO_STATION: {
   252 			case OT_GOTO_STATION: {
   253 				SetDParam(0, v->current_order.station);
   253 				SetDParam(0, v->current_order.station);
   254 				SetDParam(1, v->cur_speed * 10 >> 5);
   254 				SetDParam(1, v->cur_speed / 2);
   255 				str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
   255 				str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
   256 			} break;
   256 			} break;
   257 
   257 
   258 			case OT_GOTO_DEPOT: {
   258 			case OT_GOTO_DEPOT: {
   259 				Depot *depot = GetDepot(v->current_order.station);
   259 				Depot *depot = GetDepot(v->current_order.station);
   260 				SetDParam(0, depot->town_index);
   260 				SetDParam(0, depot->town_index);
   261 				SetDParam(1, v->cur_speed * 10 >> 5);
   261 				SetDParam(1, v->cur_speed / 2);
   262 				str = STR_HEADING_FOR_ROAD_DEPOT + _patches.vehicle_speed;
   262 				str = STR_HEADING_FOR_ROAD_DEPOT + _patches.vehicle_speed;
   263 			} break;
   263 			} break;
   264 
   264 
   265 			case OT_LOADING:
   265 			case OT_LOADING:
   266 			case OT_LEAVESTATION:
   266 			case OT_LEAVESTATION:
   268 				break;
   268 				break;
   269 
   269 
   270 			default:
   270 			default:
   271 				if (v->num_orders == 0) {
   271 				if (v->num_orders == 0) {
   272 					str = STR_NO_ORDERS + _patches.vehicle_speed;
   272 					str = STR_NO_ORDERS + _patches.vehicle_speed;
   273 					SetDParam(0, v->cur_speed * 10 >> 5);
   273 					SetDParam(0, v->cur_speed / 2);
   274 				} else
   274 				} else
   275 					str = STR_EMPTY;
   275 					str = STR_EMPTY;
   276 				break;
   276 				break;
   277 			}
   277 			}
   278 		}
   278 		}