(svn r24138) -Feature(ette): Ctrl+drag to add all vehicles with a shared order list to a group. (Juanjo)

This commit is contained in:
michi_cc
2012-04-17 19:44:12 +00:00
parent b80a329a5c
commit ddb44528d7
2 changed files with 36 additions and 16 deletions

View File

@@ -631,7 +631,7 @@ public:
switch (widget) {
case WID_GL_ALL_VEHICLES: // All vehicles
case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles
DoCommandP(0, DEFAULT_GROUP, this->vehicle_sel, CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE));
DoCommandP(0, DEFAULT_GROUP, this->vehicle_sel | (_ctrl_pressed ? 1 << 31 : 0), CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE));
this->vehicle_sel = INVALID_VEHICLE;
this->group_over = INVALID_GROUP;
@@ -648,7 +648,7 @@ public:
uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height);
if (id_g >= this->groups.Length()) return;
DoCommandP(0, this->groups[id_g]->index, vindex, CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE));
DoCommandP(0, this->groups[id_g]->index, vindex | (_ctrl_pressed ? 1 << 31 : 0), CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE));
break;
}