Make old group creation methods consistent with new one by calling the same command

pull/285/head
Andreas Schmitt 3 years ago
parent 05b76aa3f8
commit c2785be685

@ -2552,8 +2552,8 @@ public:
break;
case WID_O_ADD_VEH_GROUP: {
this->query_text_widget = WID_O_ADD_VEH_GROUP;
ShowQueryString(STR_EMPTY, STR_GROUP_RENAME_CAPTION, MAX_LENGTH_GROUP_NAME_CHARS, this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT | QSF_LEN_IN_CHARS);
this->SetDirty();
DoCommandP(0, this->vehicle->index | 0,0 , CMD_CREATE_GROUP_AUTO_NAME, nullptr, nullptr);
break;
}

@ -2346,7 +2346,11 @@ public:
break;
case ADI_CREATE_GROUP:
ShowQueryString(STR_EMPTY, STR_GROUP_RENAME_CAPTION, MAX_LENGTH_GROUP_NAME_CHARS, this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT | QSF_LEN_IN_CHARS);
if (!this->vehicles.empty()) {
const VehicleID vindex = (*this->vehicles.begin())->index;
this->SetDirty();
DoCommandP(0, vindex | (1 << 31),0 , CMD_CREATE_GROUP_AUTO_NAME, nullptr, nullptr);
}
break;
case ADI_TRACERESTRICT_SLOT_MGMT: {

Loading…
Cancel
Save