summaryrefslogtreecommitdiff
path: root/src/roadveh_gui.cpp
diff options
context:
space:
mode:
authorrichk <richk@openttd.org>2007-03-02 18:49:11 +0000
committerrichk <richk@openttd.org>2007-03-02 18:49:11 +0000
commitd11e36e477c9a3e7cf56cbc943b8310c2daa677d (patch)
tree1dca484c3713d4e52180c82b4ffc306b7e222e87 /src/roadveh_gui.cpp
parent0961e1bc5659e6ec7db517c35efaf1e457441cef (diff)
downloadopenttd-d11e36e477c9a3e7cf56cbc943b8310c2daa677d.tar.xz
(svn r8978) -Feature: Rewrite of transfer system.
This major feature-fix keeps track of the value of transfers offloaded at a station, and hands on to a loading vehicle a credit note proportionate to the cargo loaded. The transferring vehicle is paid only for the distance it has travelled. eg. B-C in a transfer chain A-B-C-D. When the final cargo is delivered, these credit notes are cashed, and the final vehicle is paid for A-D minus any credit notes it is carrying. The company bank balance increases by the value of the A-D route. You still need to set up a profitable route; it is still easy to make a loss on transfers by bad planning. :)
Diffstat (limited to 'src/roadveh_gui.cpp')
-rw-r--r--src/roadveh_gui.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp
index d9dd3bc98..5f32c3c50 100644
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -78,7 +78,7 @@ static void RoadVehDetailsWndProc(Window *w, WindowEvent *e)
{
SetDParam(0, v->service_interval);
SetDParam(1, v->date_of_last_service);
- DrawString(13, 90, _patches.servint_ispercent?STR_SERVICING_INTERVAL_PERCENT:STR_883C_SERVICING_INTERVAL_DAYS, 0);
+ DrawString(13, 102, _patches.servint_ispercent?STR_SERVICING_INTERVAL_PERCENT:STR_883C_SERVICING_INTERVAL_DAYS, 0);
}
DrawRoadVehImage(v, 3, 57, INVALID_VEHICLE);
@@ -100,6 +100,11 @@ static void RoadVehDetailsWndProc(Window *w, WindowEvent *e)
str = STR_8813_FROM;
}
DrawString(34, 78, str, 0);
+
+ /* Draw Transfer credits text */
+ SetDParam(0, v->cargo_feeder_share);
+ DrawString(34, 89, STR_FEEDER_CARGO_VALUE, 0);
+
} break;
case WE_CLICK: {
@@ -144,15 +149,15 @@ static const Widget _roadveh_details_widgets[] = {
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 339, 0, 13, STR_900C_DETAILS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 340, 379, 0, 13, STR_01AA_NAME, STR_902E_NAME_ROAD_VEHICLE},
{ WWT_PANEL, RESIZE_NONE, 14, 0, 379, 14, 55, 0x0, STR_NULL},
-{ WWT_PANEL, RESIZE_NONE, 14, 0, 379, 56, 88, 0x0, STR_NULL},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 89, 94, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 95, 100, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL},
-{ WWT_PANEL, RESIZE_NONE, 14, 11, 379, 89, 100, 0x0, STR_NULL},
+{ WWT_PANEL, RESIZE_NONE, 14, 0, 379, 56, 100, 0x0, STR_NULL},
+{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 101, 106, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL},
+{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 107, 112, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL},
+{ WWT_PANEL, RESIZE_NONE, 14, 11, 379, 101, 112, 0x0, STR_NULL},
{ WIDGETS_END},
};
static const WindowDesc _roadveh_details_desc = {
- WDP_AUTO, WDP_AUTO, 380, 101,
+ WDP_AUTO, WDP_AUTO, 380, 113,
WC_VEHICLE_DETAILS,WC_VEHICLE_VIEW,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_roadveh_details_widgets,