|
|
@ -1268,6 +1268,7 @@ void PlayerVehWndProc(Window *w, WindowEvent *e)
|
|
|
|
SetDParam(0, p->name_1);
|
|
|
|
SetDParam(0, p->name_1);
|
|
|
|
SetDParam(1, p->name_2);
|
|
|
|
SetDParam(1, p->name_2);
|
|
|
|
SetDParam(2, w->vscroll.count);
|
|
|
|
SetDParam(2, w->vscroll.count);
|
|
|
|
|
|
|
|
if (vl->list_length == 0) SETBIT(w->disabled_state, 9);
|
|
|
|
if (vehicle_type == VEH_Aircraft) {
|
|
|
|
if (vehicle_type == VEH_Aircraft) {
|
|
|
|
w->widget[9].unkA = STR_SEND_TO_HANGARS;
|
|
|
|
w->widget[9].unkA = STR_SEND_TO_HANGARS;
|
|
|
|
w->widget[9].tooltips = STR_SEND_TO_HANGARS_TIP;
|
|
|
|
w->widget[9].tooltips = STR_SEND_TO_HANGARS_TIP;
|
|
|
@ -1404,35 +1405,34 @@ void PlayerVehWndProc(Window *w, WindowEvent *e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
} break;
|
|
|
|
|
|
|
|
|
|
|
|
case 9: /* Left button */
|
|
|
|
case 9: { /* Left button */
|
|
|
|
|
|
|
|
uint16 window_type = w->window_number & VLW_FLAGS;
|
|
|
|
if (GB(w->window_number, 0, 8) /* OwnerID */ != _local_player) break;
|
|
|
|
if (GB(w->window_number, 0, 8) /* OwnerID */ != _local_player) break;
|
|
|
|
{
|
|
|
|
switch (window_type) {
|
|
|
|
uint16 window_type = w->window_number & VLW_FLAGS;
|
|
|
|
case VLW_STANDARD:
|
|
|
|
switch (window_type) {
|
|
|
|
case VLW_SHARED_ORDERS: {
|
|
|
|
case VLW_STANDARD:
|
|
|
|
/* Send to depot */
|
|
|
|
case VLW_SHARED_ORDERS: {
|
|
|
|
const Vehicle *v;
|
|
|
|
/* Send to depot */
|
|
|
|
assert(vl->list_length != 0);
|
|
|
|
const Vehicle *v;
|
|
|
|
v = vl->sort_list[0];
|
|
|
|
assert(vl->list_length != 0);
|
|
|
|
DoCommandP(v->tile, v->index, window_type | _ctrl_pressed ? 3 : 2, NULL, CMD_SEND_TO_DEPOT(vehicle_type));
|
|
|
|
v = vl->sort_list[0];
|
|
|
|
break;
|
|
|
|
DoCommandP(v->tile, v->index, window_type | _ctrl_pressed ? 3 : 2, NULL, CMD_SEND_TO_DEPOT(vehicle_type));
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case VLW_STATION_LIST:
|
|
|
|
|
|
|
|
/* Build new Vehicle */
|
|
|
|
|
|
|
|
switch (vehicle_type) {
|
|
|
|
|
|
|
|
case VEH_Train: ShowBuildTrainWindow(0); break;
|
|
|
|
|
|
|
|
case VEH_Road: ShowBuildRoadVehWindow(0); break;
|
|
|
|
|
|
|
|
case VEH_Ship: ShowBuildShipWindow(0); break;
|
|
|
|
|
|
|
|
case VEH_Aircraft: ShowBuildAircraftWindow(0); break;
|
|
|
|
|
|
|
|
default: NOT_REACHED(); break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: NOT_REACHED(); break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case VLW_STATION_LIST:
|
|
|
|
|
|
|
|
/* Build new Vehicle */
|
|
|
|
|
|
|
|
switch (vehicle_type) {
|
|
|
|
|
|
|
|
case VEH_Train: ShowBuildTrainWindow(0); break;
|
|
|
|
|
|
|
|
case VEH_Road: ShowBuildRoadVehWindow(0); break;
|
|
|
|
|
|
|
|
case VEH_Ship: ShowBuildShipWindow(0); break;
|
|
|
|
|
|
|
|
case VEH_Aircraft: ShowBuildAircraftWindow(0); break;
|
|
|
|
|
|
|
|
default: NOT_REACHED(); break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: NOT_REACHED(); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
case 10: /* Right button */
|
|
|
|
case 10: /* Right button */
|
|
|
|
ShowReplaceVehicleWindow(vehicle_type);
|
|
|
|
ShowReplaceVehicleWindow(vehicle_type);
|
|
|
|