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

This commit is contained in:
Andreas Schmitt 2021-06-20 10:22:43 +02:00
parent 05b76aa3f8
commit c2785be685
2 changed files with 7 additions and 3 deletions

View File

@ -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;
}

View File

@ -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: {