OpenTTD

Tasklist

FS#4458 - New vehicles gui does not open when cloning vehicles with shared orders.

Attached to Project: OpenTTD
Opened by Daniel (chillcore) - Tuesday, 01 February 2011, 17:39 GMT
Last edited by frosch (frosch) - Sunday, 09 December 2012, 16:59 GMT
Type Patch
Category Vehicles → Clone vehicles
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

As titel says.


When cloning vehicles with shared orders they usually share the rest too and changes are not likely to be made between them. (eg.refit, consist, etc)
The guis just clutter the main view and serve no useful purpose in this case. (if someone wants to change something anyway, for whatever reason, he/she can still click the vehicle from the depot ...)


Code below changes the "new vehicle window pops open" behaviour when cloning vehicles with shared orders only.
New vehicle gui still opens when cloning a vehicle normally.
The code affects both cloning from the depot gui and from the vehicle gui.

As the change to make is minor I have posted the code to change instead of a patch ... if needed/prefered I can post one.

Line 144 (as in r21936) in depot_gui.cpp.

- ShowVehicleViewWindow(v);
+ if (!_ctrl_pressed) ShowVehicleViewWindow(v);


Regards,
Chillcore.

PS: Credits to DJ Nekkid for the idea. In the event you wish to include this into trunk you may credit him instead of me. I only found the sweet spot. ;)
This task depends upon

Closed by  frosch (frosch)
Sunday, 09 December 2012, 16:59 GMT
Reason for closing:  Implemented
Additional comments about closing:  in r24808, _ctrl_pressed cannot be used in the command callback; ctrl might already been unpressed when the command return from the server

Loading...