summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-06-05 23:01:10 +0000
committerhackykid <hackykid@openttd.org>2005-06-05 23:01:10 +0000
commit09aadafda1dfb08780fade5a52289a0742f84674 (patch)
tree68e68cdc1f6ef01d2a66211c1c860e94421fdfa9 /vehicle_gui.c
parentea57dee837307d7a86a040e4121779f8e4bd1927 (diff)
downloadopenttd-09aadafda1dfb08780fade5a52289a0742f84674.tar.xz
(svn r2413) - Codechange: Rewrite the displaying of purchase details a bit, make it easyer to add lines later.
- Add: In the purchase details for trains display "(refittable)" after the capacity if the vehicle is refittable.
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r--vehicle_gui.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 16edc3b99..48594cc56 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -844,12 +844,10 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
if (selected_id[i] != -1) {
if (!(RailVehInfo(selected_id[i])->flags & RVI_WAGON)) {
/* it's an engine */
- Set_DPARAM_Train_Engine_Build_Window(selected_id[i]);
- DrawString(2 + offset, 15 + (14 * w->vscroll.cap), STR_8817_COST_WEIGHT_T_SPEED_POWER, 0);
+ DrawTrainEnginePurchaseInfo(2 + offset, 15 + (14 * w->vscroll.cap), selected_id[i]);
} else {
/* it's a wagon. Train cars are not replaced with the current GUI, but this code is ready for newgrf if anybody adds that*/
- Set_DPARAM_Train_Car_Build_Window(w, selected_id[i]);
- DrawString(2 + offset, 15 + (14 * w->vscroll.cap), STR_8821_COST_WEIGHT_T_T_CAPACITY, 0);
+ DrawTrainWagonPurchaseInfo(2 + offset, 15 + (14 * w->vscroll.cap), selected_id[i]);
}
}
}
@@ -858,11 +856,9 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
case VEH_Road: {
if (selected_id[0] != -1) {
- Set_DPARAM_Road_Veh_Build_Window(selected_id[0]);
- DrawString(2, 15 + (14 * w->vscroll.cap), STR_9008_COST_SPEED_RUNNING_COST, 0);
+ DrawRoadVehPurchaseInfo(2, 15 + (14 * w->vscroll.cap), selected_id[0]);
if (selected_id[1] != -1) {
- Set_DPARAM_Road_Veh_Build_Window(selected_id[1]);
- DrawString(2 + 228, 15 + (14 * w->vscroll.cap), STR_9008_COST_SPEED_RUNNING_COST, 0);
+ DrawRoadVehPurchaseInfo(2 + 228, 15 + (14 * w->vscroll.cap), selected_id[1]);
}
}
break;
@@ -870,11 +866,9 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
case VEH_Ship: {
if (selected_id[0] != -1) {
- Set_DPARAM_Ship_Build_Window(selected_id[0]);
- DrawString(2, 15 + (24 * w->vscroll.cap), STR_980A_COST_SPEED_CAPACITY_RUNNING, 0);
+ DrawShipPurchaseInfo(2, 15 + (24 * w->vscroll.cap), selected_id[0]);
if (selected_id[1] != -1) {
- Set_DPARAM_Ship_Build_Window(selected_id[1]);
- DrawString(2 + 228, 15 + (24 * w->vscroll.cap), STR_980A_COST_SPEED_CAPACITY_RUNNING, 0);
+ DrawShipPurchaseInfo(2 + 228, 15 + (24 * w->vscroll.cap), selected_id[1]);
}
}
break;
@@ -882,11 +876,9 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
case VEH_Aircraft: {
if (selected_id[0] != -1) {
- Set_DPARAM_Aircraft_Build_Window(selected_id[0]);
- DrawString(2, 15 + (24 * w->vscroll.cap), STR_A007_COST_SPEED_CAPACITY_PASSENGERS, 0);
+ DrawAircraftPurchaseInfo(2, 15 + (24 * w->vscroll.cap), selected_id[0]);
if (selected_id[1] != -1) {
- Set_DPARAM_Aircraft_Build_Window(selected_id[1]);
- DrawString(2 + 228, 15 + (24 * w->vscroll.cap), STR_A007_COST_SPEED_CAPACITY_PASSENGERS, 0);
+ DrawAircraftPurchaseInfo(2 + 228, 15 + (24 * w->vscroll.cap), selected_id[1]);
}
}
break;