(svn r24808) -Feature(ette) [FS#4458]: When share-cloning vehicles don't open the vehicle window of the new vehicle. The only reasonable thing to do with the new vehicle is to start it, which can also be done via the depot GUI.

pull/155/head
frosch 12 years ago
parent d5ed1d7be9
commit 3d695ab97c

@ -821,7 +821,8 @@ struct DepotWindow : Window {
*/
virtual bool OnVehicleSelect(const Vehicle *v)
{
if (DoCommandP(this->window_number, v->index, _ctrl_pressed ? 1 : 0, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle)) {
/* Suppress the vehicle GUI when share-cloning. There is no point to it, starting vehicles can also be done via the depot GUI. */
if (DoCommandP(this->window_number, v->index, _ctrl_pressed ? 1 : 0, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), _ctrl_pressed ? NULL : CcCloneVehicle)) {
ResetObjectToPlace();
}
return true;

@ -2525,9 +2525,13 @@ public:
ShowVehicleDetailsWindow(v);
break;
case WID_VV_CLONE: // clone vehicle
/* Suppress the vehicle GUI when share-cloning.
* There is no point to it except for starting the vehicle.
* For starting the vehicle the player has to open the depot GUI, which is
* most likely already open, but is also visible in the vehicle viewport. */
DoCommandP(v->tile, v->index, _ctrl_pressed ? 1 : 0,
_vehicle_command_translation_table[VCT_CMD_CLONE_VEH][v->type],
CcCloneVehicle);
_ctrl_pressed ? NULL : CcCloneVehicle);
break;
case WID_VV_TURN_AROUND: // turn around
assert(v->IsGroundVehicle());

Loading…
Cancel
Save