From 139c3470f83ed054917d0febe3630c8a68452695 Mon Sep 17 00:00:00 2001 From: terkhen Date: Sat, 22 Sep 2012 16:19:52 +0000 Subject: (svn r24544) -Fix [FS#5297]: Do not show profit from refits as cost in the refit window. --- src/lang/english.txt | 6 ++++-- src/vehicle_gui.cpp | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lang/english.txt b/src/lang/english.txt index b78aebd55..72289b179 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3427,8 +3427,10 @@ STR_VEHICLE_DETAILS_TRAIN_ARTICULATED_RV_CAPACITY :{BLACK}Capacity # Vehicle refit STR_REFIT_CAPTION :{WHITE}{VEHICLE} (Refit) STR_REFIT_TITLE :{GOLD}Select cargo type to carry: -STR_REFIT_NEW_CAPACITY_COST_OF_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}{}{BLACK}Cost of refit: {GOLD}{CURRENCY_LONG} -STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Cost of refit: {GOLD}{CURRENCY_LONG} +STR_REFIT_NEW_CAPACITY_COST_OF_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}{}{BLACK}Cost of refit: {RED}{CURRENCY_LONG} +STR_REFIT_NEW_CAPACITY_INCOME_FROM_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}{}{BLACK}Income from refit: {GREEN}{CURRENCY_LONG} +STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Cost of refit: {RED}{CURRENCY_LONG} +STR_REFIT_NEW_CAPACITY_INCOME_FROM_AIRCRAFT_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Income from refit: {GREEN}{CURRENCY_LONG} STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Select the vehicles to refit. Dragging with the mouse allows to select multiple vehicles. Clicking on an empty space will select the whole vehicle. Ctrl+Click will select a vehicle and the following chain STR_REFIT_TRAIN_LIST_TOOLTIP :{BLACK}Select type of cargo for train to carry diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index be36c0169..980bfa327 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -600,14 +600,25 @@ struct RefitWindow : public Window { SetDParam(0, option->cargo); SetDParam(1, _returned_refit_capacity); + Money money = cost.GetCost(); if (_returned_mail_refit_capacity > 0) { SetDParam(2, CT_MAIL); SetDParam(3, _returned_mail_refit_capacity); - SetDParam(4, cost.GetCost()); - return STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT; + if (money <= 0) { + SetDParam(4, -money); + return STR_REFIT_NEW_CAPACITY_INCOME_FROM_AIRCRAFT_REFIT; + } else { + SetDParam(4, money); + return STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT; + } } else { - SetDParam(2, cost.GetCost()); - return STR_REFIT_NEW_CAPACITY_COST_OF_REFIT; + if (money <= 0) { + SetDParam(2, -money); + return STR_REFIT_NEW_CAPACITY_INCOME_FROM_REFIT; + } else { + SetDParam(2, money); + return STR_REFIT_NEW_CAPACITY_COST_OF_REFIT; + } } } -- cgit v1.2.3-54-g00ecf