Changeset - r23031:b854befe8fc4
[Not reviewed]
master
0 1 0
Alexander Weiss - 6 years ago 2018-10-31 11:51:10
ik@alexanderweiss.nl
Change: Clone tool in depot window now behaves like clone button in vehicle window. Keep the tool active when share-cloning. Open the vehicle GUI when copy-cloning. (#6754)
1 file changed with 9 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/depot_gui.cpp
Show inline comments
 
@@ -908,9 +908,16 @@ 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)) {
 
			ResetObjectToPlace();
 
		if (_ctrl_pressed) {
 
			/* Share-clone, do not open new viewport, and keep tool active */
 
			DoCommandP(this->window_number, v->index, 1, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), NULL);
 
		} else {
 
			/* Copy-clone, open viewport for new vehicle, and deselect the tool (assume player wants to changs things on new vehicle) */
 
			if (DoCommandP(this->window_number, v->index, 0, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle)) {
 
				ResetObjectToPlace();
 
			}
 
		}
 

	
 
		return true;
 
	}
 

	
0 comments (0 inline, 0 general)