(svn r24544) -Fix [FS#5297]: Do not show profit from refits as cost in the refit window.

This commit is contained in:
terkhen 2012-09-22 16:19:52 +00:00
parent 77347682db
commit 139c3470f8
2 changed files with 19 additions and 6 deletions

View File

@ -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

View File

@ -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;
}
}
}