summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-08-29 23:39:57 +0000
committerbjarni <bjarni@openttd.org>2006-08-29 23:39:57 +0000
commit15f92083028b9d10b73739ce78be108c62a73759 (patch)
treed40d87b7909a66cde4dabc692991518710af28ed /vehicle_gui.c
parentb85a5d8cc87187345707cbe3c47dbb5a4ef8de27 (diff)
downloadopenttd-15f92083028b9d10b73739ce78be108c62a73759.tar.xz
(svn r6229) -Feature: Shared order lists now got a "goto depot" button
this will try to send all vehicles in the list to depots/hangars currently if one fails to find a depot, it will not tell the player
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r--vehicle_gui.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 1d7cfcc2b..3462b512b 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -1258,10 +1258,16 @@ void PlayerVehWndProc(Window *w, WindowEvent *e)
}
SetDParam(0, w->vscroll.count);
w->widget[1].unkA = STR_VEH_WITH_SHARED_ORDERS_LIST;
- w->widget[9].unkA = STR_EMPTY;
w->widget[10].unkA = STR_EMPTY;
- SETBIT(w->disabled_state, 9);
SETBIT(w->disabled_state, 10);
+
+ if (vehicle_type == VEH_Aircraft) {
+ w->widget[9].unkA = STR_SEND_TO_HANGARS;
+ w->widget[9].tooltips = STR_SEND_TO_HANGARS_TIP;
+ } else {
+ w->widget[9].unkA = STR_SEND_TO_DEPOTS;
+ w->widget[9].tooltips = STR_SEND_TO_DEPOTS_TIP;
+ }
break;
case VLW_STANDARD:
@@ -1397,7 +1403,17 @@ void PlayerVehWndProc(Window *w, WindowEvent *e)
}
} break;
- case 9: /* Build new Vehicle */
+ case 9: { /* Build new Vehicle */
+ const uint16 window_type = w->window_number & VLW_FLAGS;
+
+ if (window_type == VLW_SHARED_ORDERS) {
+ const Vehicle *v;
+ assert(vl->list_length != 0);
+ v = vl->sort_list[0];
+ DoCommandP(v->tile, v->index, _ctrl_pressed ? 3 : 2, NULL, CMD_SEND_TO_DEPOT(vehicle_type));
+ break;
+ }
+
switch (vehicle_type) {
case VEH_Train:
assert(IsWindowOfPrototype(w, _player_trains_widgets));
@@ -1418,6 +1434,7 @@ void PlayerVehWndProc(Window *w, WindowEvent *e)
default: NOT_REACHED(); break;
}
break;
+ }
case 10: {
if (vehicle_type == VEH_Train && !IsWindowOfPrototype(w, _player_trains_widgets)) break;