1218 } |
1218 } |
1219 } |
1219 } |
1220 |
1220 |
1221 void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type) |
1221 void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type) |
1222 { |
1222 { |
1223 /* If _patches.advanced_vehicle_list > 1, display the Advanced list |
1223 /* If _settings.gui.advanced_vehicle_list > 1, display the Advanced list |
1224 * if _patches.advanced_vehicle_list == 1, display Advanced list only for local player |
1224 * if _settings.gui.advanced_vehicle_list == 1, display Advanced list only for local player |
1225 * if _ctrl_pressed, do the opposite action (Advanced list x Normal list) |
1225 * if _ctrl_pressed, do the opposite action (Advanced list x Normal list) |
1226 */ |
1226 */ |
1227 |
1227 |
1228 if ((_patches.advanced_vehicle_list > (uint)(player != _local_player)) != _ctrl_pressed) { |
1228 if ((_settings.gui.advanced_vehicle_list > (uint)(player != _local_player)) != _ctrl_pressed) { |
1229 ShowPlayerGroup(player, vehicle_type); |
1229 ShowPlayerGroup(player, vehicle_type); |
1230 } else { |
1230 } else { |
1231 ShowVehicleListWindowLocal(player, VLW_STANDARD, vehicle_type, 0); |
1231 ShowVehicleListWindowLocal(player, VLW_STANDARD, vehicle_type, 0); |
1232 } |
1232 } |
1233 } |
1233 } |
1409 /** Checks whether service interval is enabled for the vehicle. */ |
1409 /** Checks whether service interval is enabled for the vehicle. */ |
1410 static bool IsVehicleServiceIntervalEnabled(const VehicleType vehicle_type) |
1410 static bool IsVehicleServiceIntervalEnabled(const VehicleType vehicle_type) |
1411 { |
1411 { |
1412 switch (vehicle_type) { |
1412 switch (vehicle_type) { |
1413 default: NOT_REACHED(); |
1413 default: NOT_REACHED(); |
1414 case VEH_TRAIN: return _patches.servint_trains != 0; break; |
1414 case VEH_TRAIN: return _settings.vehicle.servint_trains != 0; break; |
1415 case VEH_ROAD: return _patches.servint_roadveh != 0; break; |
1415 case VEH_ROAD: return _settings.vehicle.servint_roadveh != 0; break; |
1416 case VEH_SHIP: return _patches.servint_ships != 0; break; |
1416 case VEH_SHIP: return _settings.vehicle.servint_ships != 0; break; |
1417 case VEH_AIRCRAFT: return _patches.servint_aircraft != 0; break; |
1417 case VEH_AIRCRAFT: return _settings.vehicle.servint_aircraft != 0; break; |
1418 } |
1418 } |
1419 return false; // kill a compiler warning |
1419 return false; // kill a compiler warning |
1420 } |
1420 } |
1421 |
1421 |
1422 /** |
1422 /** |
1484 case VEH_TRAIN: |
1484 case VEH_TRAIN: |
1485 SetDParam(2, v->GetDisplayMaxSpeed()); |
1485 SetDParam(2, v->GetDisplayMaxSpeed()); |
1486 SetDParam(1, v->u.rail.cached_power); |
1486 SetDParam(1, v->u.rail.cached_power); |
1487 SetDParam(0, v->u.rail.cached_weight); |
1487 SetDParam(0, v->u.rail.cached_weight); |
1488 SetDParam(3, v->u.rail.cached_max_te / 1000); |
1488 SetDParam(3, v->u.rail.cached_max_te / 1000); |
1489 DrawString(2, 25, (_patches.realistic_acceleration && v->u.rail.railtype != RAILTYPE_MAGLEV) ? |
1489 DrawString(2, 25, (_settings.vehicle.realistic_acceleration && v->u.rail.railtype != RAILTYPE_MAGLEV) ? |
1490 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE : |
1490 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE : |
1491 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED, TC_FROMSTRING); |
1491 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED, TC_FROMSTRING); |
1492 break; |
1492 break; |
1493 |
1493 |
1494 case VEH_ROAD: |
1494 case VEH_ROAD: |
1512 DrawString(2, 45, _vehicle_translation_table[VST_VEHICLE_RELIABILITY_BREAKDOWNS][v->type], TC_FROMSTRING); |
1512 DrawString(2, 45, _vehicle_translation_table[VST_VEHICLE_RELIABILITY_BREAKDOWNS][v->type], TC_FROMSTRING); |
1513 |
1513 |
1514 /* Draw service interval text */ |
1514 /* Draw service interval text */ |
1515 SetDParam(0, v->service_interval); |
1515 SetDParam(0, v->service_interval); |
1516 SetDParam(1, v->date_of_last_service); |
1516 SetDParam(1, v->date_of_last_service); |
1517 DrawString(13, this->height - (v->type != VEH_TRAIN ? 11 : 23), _patches.servint_ispercent ? STR_SERVICING_INTERVAL_PERCENT : STR_883C_SERVICING_INTERVAL_DAYS, TC_FROMSTRING); |
1517 DrawString(13, this->height - (v->type != VEH_TRAIN ? 11 : 23), _settings.vehicle.servint_ispercent ? STR_SERVICING_INTERVAL_PERCENT : STR_883C_SERVICING_INTERVAL_DAYS, TC_FROMSTRING); |
1518 |
1518 |
1519 switch (v->type) { |
1519 switch (v->type) { |
1520 case VEH_TRAIN: |
1520 case VEH_TRAIN: |
1521 DrawVehicleDetails(v, 2, 57, this->vscroll.pos, this->vscroll.cap, det_tab); |
1521 DrawVehicleDetails(v, 2, 57, this->vscroll.pos, this->vscroll.cap, det_tab); |
1522 break; |
1522 break; |
1951 } else { |
1951 } else { |
1952 str = STR_8861_STOPPED; |
1952 str = STR_8861_STOPPED; |
1953 } |
1953 } |
1954 } else { |
1954 } else { |
1955 SetDParam(0, v->GetDisplaySpeed()); |
1955 SetDParam(0, v->GetDisplaySpeed()); |
1956 str = STR_TRAIN_STOPPING + _patches.vehicle_speed; |
1956 str = STR_TRAIN_STOPPING + _settings.gui.vehicle_speed; |
1957 } |
1957 } |
1958 } else { // no train |
1958 } else { // no train |
1959 str = STR_8861_STOPPED; |
1959 str = STR_8861_STOPPED; |
1960 } |
1960 } |
1961 } else { // vehicle is in a "normal" state, show current order |
1961 } else { // vehicle is in a "normal" state, show current order |
1962 switch (v->current_order.GetType()) { |
1962 switch (v->current_order.GetType()) { |
1963 case OT_GOTO_STATION: { |
1963 case OT_GOTO_STATION: { |
1964 SetDParam(0, v->current_order.GetDestination()); |
1964 SetDParam(0, v->current_order.GetDestination()); |
1965 SetDParam(1, v->GetDisplaySpeed()); |
1965 SetDParam(1, v->GetDisplaySpeed()); |
1966 str = STR_HEADING_FOR_STATION + _patches.vehicle_speed; |
1966 str = STR_HEADING_FOR_STATION + _settings.gui.vehicle_speed; |
1967 } break; |
1967 } break; |
1968 |
1968 |
1969 case OT_GOTO_DEPOT: { |
1969 case OT_GOTO_DEPOT: { |
1970 if (v->type == VEH_AIRCRAFT) { |
1970 if (v->type == VEH_AIRCRAFT) { |
1971 /* Aircrafts always go to a station, even if you say depot */ |
1971 /* Aircrafts always go to a station, even if you say depot */ |
1975 Depot *depot = GetDepot(v->current_order.GetDestination()); |
1975 Depot *depot = GetDepot(v->current_order.GetDestination()); |
1976 SetDParam(0, depot->town_index); |
1976 SetDParam(0, depot->town_index); |
1977 SetDParam(1, v->GetDisplaySpeed()); |
1977 SetDParam(1, v->GetDisplaySpeed()); |
1978 } |
1978 } |
1979 if ((v->current_order.GetDepotActionType() & ODATFB_HALT) && !(v->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS)) { |
1979 if ((v->current_order.GetDepotActionType() & ODATFB_HALT) && !(v->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS)) { |
1980 str = _heading_for_depot_strings[v->type] + _patches.vehicle_speed; |
1980 str = _heading_for_depot_strings[v->type] + _settings.gui.vehicle_speed; |
1981 } else { |
1981 } else { |
1982 str = _heading_for_depot_service_strings[v->type] + _patches.vehicle_speed; |
1982 str = _heading_for_depot_service_strings[v->type] + _settings.gui.vehicle_speed; |
1983 } |
1983 } |
1984 } break; |
1984 } break; |
1985 |
1985 |
1986 case OT_LOADING: |
1986 case OT_LOADING: |
1987 str = STR_882F_LOADING_UNLOADING; |
1987 str = STR_882F_LOADING_UNLOADING; |
1988 break; |
1988 break; |
1989 |
1989 |
1990 case OT_GOTO_WAYPOINT: { |
1990 case OT_GOTO_WAYPOINT: { |
1991 assert(v->type == VEH_TRAIN); |
1991 assert(v->type == VEH_TRAIN); |
1992 SetDParam(0, v->current_order.GetDestination()); |
1992 SetDParam(0, v->current_order.GetDestination()); |
1993 str = STR_HEADING_FOR_WAYPOINT + _patches.vehicle_speed; |
1993 str = STR_HEADING_FOR_WAYPOINT + _settings.gui.vehicle_speed; |
1994 SetDParam(1, v->GetDisplaySpeed()); |
1994 SetDParam(1, v->GetDisplaySpeed()); |
1995 break; |
1995 break; |
1996 } |
1996 } |
1997 |
1997 |
1998 case OT_LEAVESTATION: |
1998 case OT_LEAVESTATION: |