diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lang/english.txt | 49 | ||||
-rw-r--r-- | src/order_cmd.cpp | 12 | ||||
-rw-r--r-- | src/train_cmd.cpp | 6 | ||||
-rw-r--r-- | src/vehicle.cpp | 25 |
4 files changed, 31 insertions, 61 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt index 4bfc1d78a..3840a0816 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -482,9 +482,9 @@ STR_019C_ROAD_VEHICLE :Road vehicle STR_019D_AIRCRAFT :Aircraft STR_019E_SHIP :Ship STR_019F_TRAIN :Train -STR_01A0_IS_GETTING_OLD :{WHITE}{STRING} {COMMA} is getting old -STR_01A1_IS_GETTING_VERY_OLD :{WHITE}{STRING} {COMMA} is getting very old -STR_01A2_IS_GETTING_VERY_OLD_AND :{WHITE}{STRING} {COMMA} is getting very old and urgently needs replacing +STR_01A0_IS_GETTING_OLD :{WHITE}{VEHICLE} is getting old +STR_01A1_IS_GETTING_VERY_OLD :{WHITE}{VEHICLE} is getting very old +STR_01A2_IS_GETTING_VERY_OLD_AND :{WHITE}{VEHICLE} is getting very old and urgently needs replacing STR_01A3_LAND_AREA_INFORMATION :{WHITE}Land Area Information STR_01A4_COST_TO_CLEAR_N_A :{BLACK}Cost to clear: {LTBLUE}N/A STR_01A5_COST_TO_CLEAR :{BLACK}Cost to clear: {RED}{CURRENCY} @@ -994,36 +994,21 @@ STR_CANT_SHARE_ORDER_LIST :{WHITE}Can't sh STR_CANT_COPY_ORDER_LIST :{WHITE}Can't copy order list... STR_END_OF_SHARED_ORDERS :{SETX 10}- - End of Shared Orders - - -STR_TRAIN_IS_STUCK :{WHITE}Train {COMMA} can't find a path to continue. -STR_TRAIN_IS_LOST :{WHITE}Train {COMMA} is lost. -STR_TRAIN_IS_UNPROFITABLE :{WHITE}Train {COMMA}'s profit last year was {CURRENCY} +STR_TRAIN_IS_STUCK :{WHITE}{VEHICLE} can't find a path to continue. +STR_TRAIN_IS_LOST :{WHITE}{VEHICLE} is lost. +STR_TRAIN_IS_UNPROFITABLE :{WHITE}{VEHICLE}'s profit last year was {CURRENCY} STR_EURO_INTRODUCE :{BLACK}{BIGFONT}European Monetary Union!{}{}The Euro is introduced as the sole currency for everyday transactions in your country! # Start of order review system. # DON'T ADD OR REMOVE LINES HERE -STR_TRAIN_HAS_TOO_FEW_ORDERS :{WHITE}Train {COMMA} has too few orders in the schedule -STR_TRAIN_HAS_VOID_ORDER :{WHITE}Train {COMMA} has a void order -STR_TRAIN_HAS_DUPLICATE_ENTRY :{WHITE}Train {COMMA} has duplicate orders -STR_TRAIN_HAS_INVALID_ENTRY :{WHITE}Train {COMMA} has an invalid station in its orders -STR_ROADVEHICLE_HAS_TOO_FEW_ORDERS :{WHITE}Road Vehicle {COMMA} has too few orders in the schedule -STR_ROADVEHICLE_HAS_VOID_ORDER :{WHITE}Road Vehicle {COMMA} has a void order -STR_ROADVEHICLE_HAS_DUPLICATE_ENTRY :{WHITE}Road Vehicle {COMMA} has duplicate orders -STR_ROADVEHICLE_HAS_INVALID_ENTRY :{WHITE}Road Vehicle {COMMA} has an invalid station in its orders -STR_SHIP_HAS_TOO_FEW_ORDERS :{WHITE}Ship {COMMA} has too few orders in the schedule -STR_SHIP_HAS_VOID_ORDER :{WHITE}Ship {COMMA} has a void order -STR_SHIP_HAS_DUPLICATE_ENTRY :{WHITE}Ship {COMMA} has duplicate orders -STR_SHIP_HAS_INVALID_ENTRY :{WHITE}Ship {COMMA} has an invalid station in its orders -STR_AIRCRAFT_HAS_TOO_FEW_ORDERS :{WHITE}Aircraft {COMMA} has too few orders in the schedule -STR_AIRCRAFT_HAS_VOID_ORDER :{WHITE}Aircraft {COMMA} has a void order -STR_AIRCRAFT_HAS_DUPLICATE_ENTRY :{WHITE}Aircraft {COMMA} has duplicate orders -STR_AIRCRAFT_HAS_INVALID_ENTRY :{WHITE}Aircraft {COMMA} has an invalid station in its orders +STR_VEHICLE_HAS_TOO_FEW_ORDERS :{WHITE}{VEHICLE} has too few orders in the schedule +STR_VEHICLE_HAS_VOID_ORDER :{WHITE}{VEHICLE} has a void order +STR_VEHICLE_HAS_DUPLICATE_ENTRY :{WHITE}{VEHICLE} has duplicate orders +STR_VEHICLE_HAS_INVALID_ENTRY :{WHITE}{VEHICLE} has an invalid station in its orders # end of order system -STR_TRAIN_AUTORENEW_FAILED :{WHITE}Autorenew failed on train {COMMA}{}{STRING} -STR_ROADVEHICLE_AUTORENEW_FAILED :{WHITE}Autorenew failed on road vehicle {COMMA}{}{STRING} -STR_SHIP_AUTORENEW_FAILED :{WHITE}Autorenew failed on ship {COMMA}{}{STRING} -STR_AIRCRAFT_AUTORENEW_FAILED :{WHITE}Autorenew failed on aircraft {COMMA}{}{STRING} -STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}Train {COMMA} is too long after replacement +STR_VEHICLE_AUTORENEW_FAILED :{WHITE}Autorenew failed on {VEHICLE}{}{STRING} +STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}{VEHICLE} is too long after replacement STR_AUTOREPLACE_NOTHING_TO_DO :{WHITE}No autoreplace/renew rules applied. STR_AUTOREPLACE_MONEY_LIMIT :(money limit) @@ -2824,7 +2809,7 @@ STR_UNKNOWN_STATION :unknown station STR_8812_EMPTY :{LTBLUE}Empty STR_8813_FROM :{LTBLUE}{CARGO} from {STATION} STR_FROM_MULT :{LTBLUE}{CARGO} from {STATION} (x{NUM}) -STR_8814_TRAIN_IS_WAITING_IN_DEPOT :{WHITE}Train {COMMA} is waiting in depot +STR_8814_TRAIN_IS_WAITING_IN_DEPOT :{WHITE}{VEHICLE} is waiting in depot STR_8815_NEW_VEHICLES :{BLACK}New Vehicles STR_8816 :{BLACK}- STR_8819_TRAIN_TOO_LONG :{WHITE}Train too long @@ -2983,7 +2968,7 @@ STR_9012_CAPACITY :{BLACK}Capacity STR_9013_MUST_BE_STOPPED_INSIDE :{WHITE}...must be stopped inside a road vehicle depot STR_9014_CAN_T_SELL_ROAD_VEHICLE :{WHITE}Can't sell road vehicle... STR_9015_CAN_T_STOP_START_ROAD_VEHICLE :{WHITE}Can't stop/start road vehicle... -STR_9016_ROAD_VEHICLE_IS_WAITING :{WHITE}Road vehicle {COMMA} is waiting in depot +STR_9016_ROAD_VEHICLE_IS_WAITING :{WHITE}{VEHICLE} is waiting in depot STR_HEADING_FOR_ROAD_DEPOT :{ORANGE}Heading for {TOWN} Road Depot STR_HEADING_FOR_ROAD_DEPOT_VEL :{ORANGE}Heading for {TOWN} Road Depot, {VELOCITY} STR_HEADING_FOR_ROAD_DEPOT_SERVICE :{LTBLUE}Service at {TOWN} Road Depot @@ -3065,7 +3050,7 @@ STR_HEADING_FOR_SHIP_DEPOT :{ORANGE}Heading STR_HEADING_FOR_SHIP_DEPOT_VEL :{ORANGE}Heading for {TOWN} Ship Depot, {VELOCITY} STR_HEADING_FOR_SHIP_DEPOT_SERVICE :{LTBLUE}Service at {TOWN} Ship Depot STR_HEADING_FOR_SHIP_DEPOT_SERVICE_VEL :{LTBLUE}Service at {TOWN} Ship Depot, {VELOCITY} -STR_981C_SHIP_IS_WAITING_IN_DEPOT :{WHITE}Ship {COMMA} is waiting in depot +STR_981C_SHIP_IS_WAITING_IN_DEPOT :{WHITE}{VEHICLE} is waiting in depot STR_981D_BUILD_SHIP_DOCK :{BLACK}Build ship dock STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING :{BLACK}Build ship depot (for building and servicing ships) STR_981F_SHIPS_CLICK_ON_SHIP_FOR :{BLACK}Ships - click on ship for information @@ -3130,7 +3115,7 @@ STR_HEADING_FOR_HANGAR :{ORANGE}Heading STR_HEADING_FOR_HANGAR_VEL :{ORANGE}Heading for {STATION} Hangar, {VELOCITY} STR_HEADING_FOR_HANGAR_SERVICE :{LTBLUE}Service at {STATION} Hangar STR_HEADING_FOR_HANGAR_SERVICE_VEL :{LTBLUE}Service at {STATION} Hangar, {VELOCITY} -STR_A014_AIRCRAFT_IS_WAITING_IN :{WHITE}Aircraft {COMMA} is waiting in the aircraft hangar +STR_A014_AIRCRAFT_IS_WAITING_IN :{WHITE}{VEHICLE} is waiting in the aircraft hangar STR_A015_AIRCRAFT_IN_THE_WAY :{WHITE}Aircraft in the way STR_A016_CAN_T_STOP_START_AIRCRAFT :{WHITE}Can't stop/start aircraft... STR_A017_AIRCRAFT_IS_IN_FLIGHT :{WHITE}Aircraft is in flight @@ -3391,7 +3376,7 @@ STR_MASS_START_LIST_TIP :{BLACK}Click to STR_SHORT_DATE :{WHITE}{DATE_TINY} STR_SIGN_LIST_CAPTION :{WHITE}Sign List - {COMMA} Sign{P "" s} -STR_ORDER_REFIT_FAILED :{WHITE}Order refit failure stopped {STRING} {COMMA} +STR_ORDER_REFIT_FAILED :{WHITE}Order refit failure stopped {VEHICLE} ############ Lists rail types diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index a14468b07..63fbc4a3f 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -364,10 +364,10 @@ void OrderList::DebugCheckSanity() const */ static void DeleteOrderWarnings(const Vehicle* v) { - DeleteVehicleNews(v->index, STR_TRAIN_HAS_TOO_FEW_ORDERS + v->type * 4); - DeleteVehicleNews(v->index, STR_TRAIN_HAS_VOID_ORDER + v->type * 4); - DeleteVehicleNews(v->index, STR_TRAIN_HAS_DUPLICATE_ENTRY + v->type * 4); - DeleteVehicleNews(v->index, STR_TRAIN_HAS_INVALID_ENTRY + v->type * 4); + DeleteVehicleNews(v->index, STR_VEHICLE_HAS_TOO_FEW_ORDERS); + DeleteVehicleNews(v->index, STR_VEHICLE_HAS_VOID_ORDER); + DeleteVehicleNews(v->index, STR_VEHICLE_HAS_DUPLICATE_ENTRY); + DeleteVehicleNews(v->index, STR_VEHICLE_HAS_INVALID_ENTRY); } @@ -1457,10 +1457,10 @@ void CheckOrders(const Vehicle* v) /* We don't have a problem */ if (problem_type < 0) return; - message = STR_TRAIN_HAS_TOO_FEW_ORDERS + (v->type << 2) + problem_type; + message = STR_VEHICLE_HAS_TOO_FEW_ORDERS + problem_type; //DEBUG(misc, 3, "Triggered News Item for vehicle %d", v->index); - SetDParam(0, v->unitnumber); + SetDParam(0, v->index); AddNewsItem( message, NS_ADVICE, diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 9960b1be7..58981720c 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2970,7 +2970,7 @@ static Track ChooseTrainTrack(Vehicle* v, TileIndex tile, DiagDirection enterdir SetBit(v->u.rail.flags, VRF_NO_PATH_TO_DESTINATION); /* and notify user about the event */ if (_settings_client.gui.lost_train_warn && v->owner == _local_company) { - SetDParam(0, v->unitnumber); + SetDParam(0, v->index); AddNewsItem( STR_TRAIN_IS_LOST, NS_ADVICE, @@ -4310,7 +4310,7 @@ static void TrainLocoHandler(Vehicle *v, bool mode) if (HasBit(v->u.rail.flags, VRF_TRAIN_STUCK) && v->load_unload_time_rem > 2 * _settings_game.pf.wait_for_pbs_path * DAY_TICKS) { /* Show message to player. */ if (_settings_client.gui.lost_train_warn && v->owner == _local_company) { - SetDParam(0, v->unitnumber); + SetDParam(0, v->index); AddNewsItem( STR_TRAIN_IS_STUCK, NS_ADVICE, @@ -4480,7 +4480,7 @@ void TrainsYearlyLoop() /* show warning if train is not generating enough income last 2 years (corresponds to a red icon in the vehicle list) */ if (_settings_client.gui.train_income_warn && v->owner == _local_company && v->age >= 730 && v->GetDisplayProfitThisYear() < 0) { SetDParam(1, v->GetDisplayProfitThisYear()); - SetDParam(0, v->unitnumber); + SetDParam(0, v->index); AddNewsItem( STR_TRAIN_IS_UNPROFITABLE, NS_ADVICE, diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 108ccb8d7..3769b1a7f 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -716,16 +716,10 @@ void CallVehicleTicks() if (error_message == STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT) { message = error_message; } else { - switch (v->type) { - case VEH_TRAIN: message = STR_TRAIN_AUTORENEW_FAILED; break; - case VEH_ROAD: message = STR_ROADVEHICLE_AUTORENEW_FAILED; break; - case VEH_SHIP: message = STR_SHIP_AUTORENEW_FAILED; break; - case VEH_AIRCRAFT: message = STR_AIRCRAFT_AUTORENEW_FAILED; break; - default: NOT_REACHED(); - } + message = STR_VEHICLE_AUTORENEW_FAILED; } - SetDParam(0, v->unitnumber); + SetDParam(0, v->index); SetDParam(1, error_message); AddNewsItem(message, NS_ADVICE, v->index, 0); } @@ -950,13 +944,6 @@ void CheckVehicleBreakdown(Vehicle *v) } } -static const StringID _vehicle_type_names[4] = { - STR_019F_TRAIN, - STR_019C_ROAD_VEHICLE, - STR_019E_SHIP, - STR_019D_AIRCRAFT, -}; - static void ShowVehicleGettingOld(Vehicle *v, StringID msg) { if (v->owner != _local_company) return; @@ -964,8 +951,7 @@ static void ShowVehicleGettingOld(Vehicle *v, StringID msg) /* Do not show getting-old message if autorenew is active (and it can replace the vehicle) */ if (GetCompany(v->owner)->engine_renew && GetEngine(v->engine_type)->company_avail != 0) return; - SetDParam(0, _vehicle_type_names[v->type]); - SetDParam(1, v->unitnumber); + SetDParam(0, v->index); AddNewsItem(msg, NS_ADVICE, v->index, 0); } @@ -1504,8 +1490,7 @@ void VehicleEnterDepot(Vehicle *v) _vehicles_to_autoreplace[v] = false; if (v->owner == _local_company) { /* Notify the user that we stopped the vehicle */ - SetDParam(0, _vehicle_type_names[v->type]); - SetDParam(1, v->unitnumber); + SetDParam(0, v->index); AddNewsItem(STR_ORDER_REFIT_FAILED, NS_ADVICE, v->index, 0); } } else if (v->owner == _local_company && cost.GetCost() != 0) { @@ -1532,7 +1517,7 @@ void VehicleEnterDepot(Vehicle *v) default: NOT_REACHED(); string = STR_EMPTY; // Set the string to something to avoid a compiler warning } - SetDParam(0, v->unitnumber); + SetDParam(0, v->index); AddNewsItem(string, NS_ADVICE, v->index, 0); } } |