summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2012-09-22 16:19:52 +0000
committerterkhen <terkhen@openttd.org>2012-09-22 16:19:52 +0000
commit139c3470f83ed054917d0febe3630c8a68452695 (patch)
tree55e01defbfaa5d0a145116af5838e06390160296
parent77347682db0299be97b3b12e4d24d9571497a5e4 (diff)
downloadopenttd-139c3470f83ed054917d0febe3630c8a68452695.tar.xz
(svn r24544) -Fix [FS#5297]: Do not show profit from refits as cost in the refit window.
-rw-r--r--src/lang/english.txt6
-rw-r--r--src/vehicle_gui.cpp19
2 files changed, 19 insertions, 6 deletions
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;
+ }
}
}